This rule currently flags all variable length arrays, and arrays without a specified size, but which are initialized. However, various types of variable length arrays are permitted in C99 onwards.
Example
void example_function(int n, int x[n]) { // COMPLIANT[FALSE_POSITIVE]
struct S {
int x1[n]; // NON_COMPLIANT
int x2[]; // COMPLIANT[FALSE_POSITIVE]
};
int y[] = {1,2,3}; // COMPLIANT[FALSE_POSITIVE]
}
Affected rules
RULE-1-2
Description
This rule currently flags all variable length arrays, and arrays without a specified size, but which are initialized. However, various types of variable length arrays are permitted in C99 onwards.
Example