This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37481] New: -pedantic accepts flexible array member = "string" initialization
- From: "h dot b dot furuseth at usit dot uio dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2008 16:29:29 -0000
- Subject: [Bug c/37481] New: -pedantic accepts flexible array member = "string" initialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
struct Foo { int i; char a[]; } foo = { 1, "" }; // No warning
struct Bar { int i; char a[]; } bar = { 1, {0} }; // Warning
Line 1 passes -pedantic, but C99 6.7.2.1p16 says it is invalid:
Flexible array members are ignored except with ',', '->',
and for aligning the size of the struct.
Related: Bug 20407: g++ does reject it, even without -pedantic.
--
Summary: -pedantic accepts flexible array member = "string"
initialization
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: h dot b dot furuseth at usit dot uio dot no
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37481