misdiagnosis of scalar initializer for flexible array #3990
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Extended Description
--
ddunbar@milton:min$ cat /tmp/t.c
struct { int x; int y[]; } a = { 1, 2 };
ddunbar@milton:min$ ccc -fsyntax-only /tmp/t.c
/tmp/t.c:1:37: warning: excess elements in struct initializer
struct { int x; int y[]; } a = { 1, 2 };
^
1 diagnostic generated.
gcc treats "2" as a single initializer for the flexible array, I don't think we need that level of compatibility but we should at least error on this (vs miscompiling).
The text was updated successfully, but these errors were encountered: