This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63480] New: -Wmissing-field-initializers should not warn about intentionally empty initializers (or that should be a separate option)
- From: "josh at joshtriplett dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Oct 2014 04:30:59 +0000
- Subject: [Bug c/63480] New: -Wmissing-field-initializers should not warn about intentionally empty initializers (or that should be a separate option)
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63480
Bug ID: 63480
Summary: -Wmissing-field-initializers should not warn about
intentionally empty initializers (or that should be a
separate option)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: josh at joshtriplett dot org
-Wmissing-field-initializers warns if a positional initializer does not
initialize all fields. However, it does so even if the initializer is {},
which is a common idiom to initialize the entire structure to zero. Please
consider not warning in that specific case. If anyone actually *wants* GCC to
warn in that case, perhaps that could go in a separate -Wempty-initializer.
Alternatively, if people *really* want -Wmissing-field-initializers to warn
about {}, could we have some other warning option that only warns about missing
field initializers with non-empty initializers?