https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67793
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-10-01 CC| |trippels at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- In C99 you can add "static" to the array function argument: extern int func(char x[static 32]); But unfortunately gcc doesn't warn for this case yet. Clang already does: markus@x4 /tmp % clang -c test.i test.i:5:10: warning: array argument is too small; contains 8 elements, callee requires at least 32 [-Warray-bounds] return func(p); ^ ~ test.i:1:22: note: callee declares array parameter as static here extern int func(char x[static 32]); ^~~~~~~~~~~~ 1 warning generated.