https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50584
Fredrik Hederstierna <fredrik.hederstie...@securitas-direct.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fredrik.hederstierna@securi | |tas-direct.com --- Comment #14 from Fredrik Hederstierna <fredrik.hederstie...@securitas-direct.com> --- Still present in GCC-7.1.0 Simple test code: ------------------------------------- int s[1] = { 1 }; void test(int v[static 2]) { printf("%d\n", v[1]); v[1] = 0; } int main(void) { test(s); return 0; } ------------------------------------- No warnings by GCC: > gcc -c test.c -W -Wall -Wextra -Warray-bounds -O2 -std=c99 ------------------------------------- But with CLANG-3.8.0 we get warnings: > clang -c test.c test.c:13:3: warning: array argument is too small; contains 1 elements, callee requires at least 2 [-Warray-bounds] test(s); ^ ~ test.c:5:15: note: callee declares array parameter as static here void test(int v[static 2]) ^~~~~~~~~~~ 1 warning generated.