Skip to content

Nested VLA are not supported

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


Id Project Category View Due Date Updated
ID0001718 Frama-C Kernel public 2014-03-25 2015-11-04
Reporter pascal Assigned To virgile Resolution open
Priority normal Severity feature Reproducibility always
Platform - OS - OS Version -
Product Version - Target Version - Fixed in Version -

Description :

Note that I have never seen this feature actually used, but it appears to be supported by GCC and Clang.

To reiterate, I have never seen code that does int t[a][a];

This report is only for the sake of completeness.

Steps To Reproduce :

~/gitlab/frama-c $ bin/toplevel.opt -print t.c
[kernel] warning: cannot load plug-in `Aorai' (incompatible with Neon-20140301+dev).
[kernel] warning: cannot load plug-in `Obfuscator' (incompatible with Neon-20140301+dev).
[kernel] warning: cannot load plug-in `Report' (incompatible with Neon-20140301+dev).
[kernel] warning: cannot load plug-in `Security_slicing' (incompatible with Neon-20140301+dev).
[kernel] warning: cannot load plug-in `Wp' (incompatible with Neon-20140301+dev).
[kernel] preprocessing with "gcc -C -E -I.  t.c"
t.c:4:[kernel] user error: Length of array is not a constant: a
t.c:4:[kernel] warning: Variable-sized local variable t
[kernel] user error: skipping file "t.c" that has errors.
[kernel] Frama-C aborted: invalid user input.
~/gitlab/frama-c $ cat t.c
int main(int c, char **v)
{
  int a = 3;
  int t[a][a];
  t[a-1][a-1] = 1;
}
~/gitlab/frama-c $ gcc -pedantic -std=c99 t.c
~/gitlab/frama-c $
Edited by Virgile Prevosto
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information