public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings
@ 2003-12-03 13:35 d dot yu dot bolkhovityanov at inp dot nsk dot su
  2003-12-04  6:15 ` [Bug c/13282] " d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: d dot yu dot bolkhovityanov at inp dot nsk dot su @ 2003-12-03 13:35 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
@ 2003-12-04  6:15 ` d dot yu dot bolkhovityanov at inp dot nsk dot su
  2003-12-04  8:25 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: d dot yu dot bolkhovityanov at inp dot nsk dot su @ 2003-12-04  6:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From d dot yu dot bolkhovityanov at inp dot nsk dot su  2003-12-04 06:15 -------
Sorry for a bit fuzzy bugreport, what I wanted to say is:
it is a request for enhancement -- a separate switch to turn on/off the "missing
initializer" warning is requested.

-- 


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
  2003-12-04  6:15 ` [Bug c/13282] " d dot yu dot bolkhovityanov at inp dot nsk dot su
@ 2003-12-04  8:25 ` pinskia at gcc dot gnu dot org
  2003-12-04  8:28 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-04  8:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-04 08:25 -------
This is for the ping of the patch, it needs to be updated at least for the new way of handling 
options but also it should be updated for Neil Booth's concerns: <http://gcc.gnu.org/ml/gcc-
patches/2002-05/msg00314.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic, patch
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-04 08:25:48
               date|                            |
   Target Milestone|---                         |3.4


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
  2003-12-04  6:15 ` [Bug c/13282] " d dot yu dot bolkhovityanov at inp dot nsk dot su
  2003-12-04  8:25 ` pinskia at gcc dot gnu dot org
@ 2003-12-04  8:28 ` pinskia at gcc dot gnu dot org
  2003-12-04  8:35 ` rsandifo at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-04  8:28 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rsandifo at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (2 preceding siblings ...)
  2003-12-04  8:28 ` pinskia at gcc dot gnu dot org
@ 2003-12-04  8:35 ` rsandifo at gcc dot gnu dot org
  2003-12-04 11:28 ` d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2003-12-04  8:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rsandifo at gcc dot gnu dot org  2003-12-04 08:35 -------
Well, OK, but don't hold your breath ;)  There's no way this can go into 3.4,
and I've seen comments from SC members that 3.5 is unlikely to be released
until 2005.

I'll try to find time to get back to this once 3.4 has branched.


-- 


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (3 preceding siblings ...)
  2003-12-04  8:35 ` rsandifo at gcc dot gnu dot org
@ 2003-12-04 11:28 ` d dot yu dot bolkhovityanov at inp dot nsk dot su
  2003-12-04 11:49 ` rsandifo at redhat dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: d dot yu dot bolkhovityanov at inp dot nsk dot su @ 2003-12-04 11:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From d dot yu dot bolkhovityanov at inp dot nsk dot su  2003-12-04 11:28 -------
Glad to see that there are provisions for this switch!

Richard, you write "There's no way this can go into 3.4" -- can you please tell
me what the barrier is?  Is it a "code freeze" or similar deadline, or is it
because or your time?  In the latter case I'll be glad to make the patch
suitable for current code, with above specified modifications.

-- 


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (4 preceding siblings ...)
  2003-12-04 11:28 ` d dot yu dot bolkhovityanov at inp dot nsk dot su
@ 2003-12-04 11:49 ` rsandifo at redhat dot com
  2003-12-18 17:53 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at redhat dot com @ 2003-12-04 11:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rsandifo at redhat dot com  2003-12-04 11:49 -------
Subject: Re:  A "-Wno..." switch to turn off "missing initializer" warnings

> Richard, you write "There's no way this can go into 3.4" -- can you
> please tell me what the barrier is?  Is it a "code freeze" or similar
> deadline, or is it because or your time?

Ah, sorry, I should have said.  It's a code freeze.  Only bug fixes
are being accepted at this stage.

Richard


-- 


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (5 preceding siblings ...)
  2003-12-04 11:49 ` rsandifo at redhat dot com
@ 2003-12-18 17:53 ` steven at gcc dot gnu dot org
  2004-05-26 18:04 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2003-12-18 17:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2003-12-18 17:36 -------
An enhancement, but we are in stage3.  Richard Sandiford has indicated he'll 
get back to this after 3.4 has branched, so I'm moving the target milestone. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-12-04 08:25:48         |2003-12-18 17:36:36
               date|                            |
   Target Milestone|3.4.0                       |3.5


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (6 preceding siblings ...)
  2003-12-18 17:53 ` steven at gcc dot gnu dot org
@ 2004-05-26 18:04 ` pinskia at gcc dot gnu dot org
  2004-08-06 11:23 ` cvs-commit at gcc dot gnu dot org
  2004-08-06 11:26 ` rsandifo at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-26 18:04 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |---


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (7 preceding siblings ...)
  2004-05-26 18:04 ` pinskia at gcc dot gnu dot org
@ 2004-08-06 11:23 ` cvs-commit at gcc dot gnu dot org
  2004-08-06 11:26 ` rsandifo at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-06 11:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-06 11:23 -------
Subject: Bug 13282

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rsandifo@gcc.gnu.org	2004-08-06 11:23:23

Modified files:
	gcc            : ChangeLog c.opt c-opts.c c-typeck.c 
	gcc/cp         : ChangeLog typeck2.c 
	gcc/doc        : invoke.texi 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: missing-field-init-1.c 
	                      missing-field-init-2.c 
	gcc/testsuite/g++.dg/warn: missing-field-init-1.C 
	                           missing-field-init-2.C 

Log message:
	PR c/13282
	* c.opt (Wmissing-field-initializers): New option.
	* c-opts.c (c_common_post_options): Make -Wextra turn it on by default.
	* c-typeck.c (pop_init_level): Guard the missing field warning with
	warn_missing_field_initializers rather than extra_warnings.
	* doc/invoke.texi (-Wmissing-field-initializers): Document, moving
	some of the explanation from...
	(-Wextra): ...here.  Say that the missing field warning can be
	seperately controlled by -Wmissing-field-initializers.
	
	cp/
	* typeck2.c (process_init_constructor): Guard the missing field warning
	with warn_missing_field_initializers rather than extra_warnings.
	
	testsuite/
	* gcc.dg/missing-field-init-[12].c: New tests.
	* g++.dg/warn/missing-field-init-[12].C: New tests.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4821&r2=2.4822
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c.opt.diff?cvsroot=gcc&r1=1.31&r2=1.32
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-opts.c.diff?cvsroot=gcc&r1=1.123&r2=1.124
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.353&r2=1.354
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4267&r2=1.4268
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.167&r2=1.168
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&r1=1.498&r2=1.499
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4104&r2=1.4105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/missing-field-init-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/missing-field-init-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/missing-field-init-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/missing-field-init-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c/13282] A "-Wno..." switch to turn off "missing initializer" warnings
  2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
                   ` (8 preceding siblings ...)
  2004-08-06 11:23 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-06 11:26 ` rsandifo at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu dot org @ 2004-08-06 11:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rsandifo at gcc dot gnu dot org  2004-08-06 11:26 -------
Patch applied to 3.5.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


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

end of thread, other threads:[~2004-08-06 11:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-03 13:35 [Bug c/13282] New: A "-Wno..." switch to turn off "missing initializer" warnings d dot yu dot bolkhovityanov at inp dot nsk dot su
2003-12-04  6:15 ` [Bug c/13282] " d dot yu dot bolkhovityanov at inp dot nsk dot su
2003-12-04  8:25 ` pinskia at gcc dot gnu dot org
2003-12-04  8:28 ` pinskia at gcc dot gnu dot org
2003-12-04  8:35 ` rsandifo at gcc dot gnu dot org
2003-12-04 11:28 ` d dot yu dot bolkhovityanov at inp dot nsk dot su
2003-12-04 11:49 ` rsandifo at redhat dot com
2003-12-18 17:53 ` steven at gcc dot gnu dot org
2004-05-26 18:04 ` pinskia at gcc dot gnu dot org
2004-08-06 11:23 ` cvs-commit at gcc dot gnu dot org
2004-08-06 11:26 ` rsandifo at gcc dot gnu dot 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).