Skip to content

Support skipping variadic functions #943

Description

@r-ross

Applying CN to source code with variadic functions always fails. For example

$ cat hi.c
extern int printf (const char *format, ...);
/*@ spec printf(pointer format);
    requires true;
    ensures true;
@*/

int main (void)
{
   printf("Hi world");
   return 0;
}

$ cn verify hi.c
cn: internal error, uncaught exception:
    File "backend/cn/lib/wellTyped.ml", line 2064, characters 14-20: Assertion failed
    Raised at Cn__WellTyped.BaseTyping.infer_expr in file "backend/cn/lib/wellTyped.ml", line 2064, characters 14-38
    Called from Cn__Typing.bind.(fun) in file "backend/cn/lib/typing.ml", line 49, characters 17-20
...

Running cn verify --skip=printf hi.c has the same result. Using /*@ trusted; @*/ {} results in error: unsupported variadic functions which is better, but I don't see how to completely skip checking a function including its prototype. Please provide a way to completely skip variadic functions, either by extending trusted or by adding something new such as /*@ skip; @*/.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions