http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47772

           Summary: warnings from -Wmissing-field-initializers contradict
                    documentation
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: dar...@kulp.ch


Created attachment 23367
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23367
testcase re: -Wmissing-field-initializers and designated initializers

According to gcc(1):

-Wmissing-field-initializers
           Warn if a structure's initializer has some fields missing. ... This
option does not warn about designated initializers ....

This I find normally to be true. Attached is a test case that produces the
following warning on GCC 4.2.1, 4.4.4., and 4.5.2:

$ gcc -save-temps -Wmissing-field-initializers  -c test3.c
test3.c:14: warning: missing initializer
test3.c:14: warning: (near initialization for ‘(anonymous)[0].b’)

If the `b' field is initialized either before or after the `a' field, the
warning disappears, but this should not be necessary, according to the
documentation.

Reply via email to