This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/40136] New: Initializing a union whose first member is an anonymous struct
- From: "markleone at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 May 2009 23:21:11 -0000
- Subject: [Bug c/40136] New: Initializing a union whose first member is an anonymous struct
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Not sure if this is a bug or a standards interpretation issue. Consider the
following union, whose first member is an anonymous struct:
union Foo {
struct { float a,b,c; };
const char* x;
};
icc (10.1) permits initialization of the first member of the union:
Foo foo = { .0f, .0f, .0f };
gcc (4.0.1) doesn't permit that, but does permit the following, which I believe
should not be accepted:
Foo foo = { "foo" };
--
Summary: Initializing a union whose first member is an anonymous
struct
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: markleone at gmail dot com
GCC host triplet: i686-apple-darwin9-gcc-4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40136