by yxhuvud · 13y ago · 0 comments
What happen if you do
void bar(int fooArray[static 0]) {} ?
Is NULL allowed?
test.c:3:30: warning: 'static' has no effect on zero-length arrays [-Warray-bounds]The “expression” here refers to an expression in between [] in an array declaration; so the declaration of size 0 is a constraint violation and requires a diagnostic. You can get gcc and clang to issue a relevant diagnostic with “-std=c99 -pedantic”.