Skip to content

2D variable length array

ID0002186: This issue was created automatically from Mantis Issue 2186. Further discussion may take place here.


Id Project Category View Due Date Updated
ID0002186 Frama-C Kernel public 2015-11-03 2018-11-30
Reporter signoles Assigned To virgile Resolution duplicate
Priority normal Severity major Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C Sodium Target Version - Fixed in Version -

Description :

2D variable length arrays are valid wrt C99 but rejected by Frama-C:

===== extern int n;

int main(void) { int a[n]; // accepted int b[n][n]; // should be accepted, but refused return 0; }

$ frama-c a.i [kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing) [kernel] Parsing a.i (no preprocessing) a.i:4:[kernel] warning: Variable-sized local variable a a.i:5:[kernel] user error: Length of array is not a constant: n a.i:5:[kernel] warning: Variable-sized local variable b [kernel] user error: stopping on file "a.i" that has errors. [kernel] Frama-C aborted: invalid user input.

Additional Information :

Reported by email by G. Karpenkov

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information