public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47772] New: warnings from -Wmissing-field-initializers contradict documentation
@ 2011-02-16 20:49 darren at kulp dot ch
  2011-02-16 21:08 ` [Bug c/47772] " darren at kulp dot ch
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: darren at kulp dot ch @ 2011-02-16 20:49 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: darren@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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-18 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-16 20:49 [Bug c/47772] New: warnings from -Wmissing-field-initializers contradict documentation darren at kulp dot ch
2011-02-16 21:08 ` [Bug c/47772] " darren at kulp dot ch
2011-02-21 17:03 ` webmaster@sky-siteweb.com
2012-04-18 13:00 ` vadmium+gc at gmail dot com
2012-04-18 13:27 ` manu at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).