[Bug c/64709] New: Bogus -Wmissing-field-initializers warning

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 21 12:30:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64709

            Bug ID: 64709
           Summary: Bogus -Wmissing-field-initializers warning
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

$ ./cc1 -quiet q.c -Wmissing-field-initializers
q.c: In function ‘foo’:
q.c:5:10: warning: missing initializer for field ‘b’ of ‘struct S’
[-Wmissing-field-initializers]
   struct S s[] = { { 1, 2 }, { 0 } };
          ^
q.c:1:19: note: ‘b’ declared here
 struct S { int a, b; };
                   ^
$ cat q.c
struct S { int a, b; };
void
foo (void)
{
  struct S s[] = { { 1, 2 }, { 0 } };
}

Started with r211289.


More information about the Gcc-bugs mailing list