[Bug c/60784] Spurious -Wmissing-field-initializers warning for anonymous structure
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 9 20:04:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60784
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
It looks like this isn't about whether the struct is anonymous, we warn even on
say:
struct A { int a, b; };
struct B { struct A a; } b = { .a.a = 1, .a.b = 1 };
c.c:2:19: warning: missing initializer for field ‘b’ of ‘struct A’
[-Wmissing-field-initializers]
struct B { struct A a; } b = { .a.a = 1, .a.b = 1 };
^
c.c:1:19: note: ‘b’ declared here
struct A { int a, b; };
^
More information about the Gcc-bugs
mailing list