This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings
- From: "d dot yu dot bolkhovityanov at inp dot nsk dot su" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2003 13:35:55 -0000
- Subject: [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
With "-W -Wall" gcc, among several useful warnings, prints warnings if an
aggregate initializes only some of the members.
With declaration like
struct {int v; int f;} a[2] = {
{10, 1},
{15}
};
it warns about "missing initializer (near initialization for `a[1].f')".
But leaving some elements to be implicitly initialized with zeroes is perfectly
legitimate in C, so one has a hard choice: either switch off all "-W" warnings
altogether, or cope with tons of "missing initializer" warnings.
A switch to turn this warning on/off separate from "-W" could be an excellent
solution, and it was discussed several times (see e.g.
http://gcc.gnu.org/ml/gcc-patches/2002-05/msg00664.html) with patches proposed.
But, for some reasons, these patches never found their way to CVS.
--
Summary: A "-Wno..." switch to turn off "missing initializer"
warnings
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: d dot yu dot bolkhovityanov at inp dot nsk dot su
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13282