Question

Here's a quick test-case reduced from a much larger program that yielded a syntax error with frama-c NEON:

cat <<"EOF" > min.i
struct list;
typedef struct list list_t;
void list_merge(list_t *, list_t *, int (const void *, const void *));
EOF
frama-c -val min.i

Is frama-c restricted to some subset of c99 that I'm violating here?

Was it helpful?

Solution

void list_merge(int(int)); is accepted by Clang and GCC, but rejected by http://cdecl.org/

It seems to be valid syntax (relevant is the definition of abstract-declarator at 6.7.7:1 in C11):

abstract-declarator:
    pointer
    pointeropt direct-abstract-declarator
direct-abstract-declarator:
    ( abstract-declarator )
    direct-abstract-declaratoropt [ type-qualifier-listopt assignment-expressionopt ]
    direct-abstract-declaratoropt [ static type-qualifier-listopt assignment-expression ]
    direct-abstract-declaratoropt [ type-qualifier-list static assignment-expression ]
    direct-abstract-declaratoropt [ * ] direct-abstract-declaratoropt ( parameter-type-listopt )

In other words, yes, it appears that Frama-C is restricted to the subset of non-strange abstract declarators for function parameters. It is probably a simple omission and can probably be fixed if you report it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top