This is the mail archive of the
mailing list for the GCC project.
Re: a warning to implement
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Joe Buck <jbuck at synopsys dot com>
- Cc: dewar at gnat dot com (Robert Dewar), aoliva at redhat dot com, gcc at gcc dot gnu dot org, gdr at codesourcery dot com, phil at jaj dot com
- Date: 06 Feb 2002 20:37:42 +0100
- Subject: Re: a warning to implement
- Organization: CodeSourcery, LLC
- References: <200202061847.KAA04566@atrus.synopsys.com>
Joe Buck <jbuck@synopsys.COM> writes:
| In fact "int a = a" uses an uninitialized variable and should give
| warnings according to *current documentation* when -Wall is given, but
| evidently Gaby wants us to preserve this botch indefinitely!
Joe, that is not a fair or accurate representation of my
position. I'll repeat it again: I'm not opposed to an option that
warns about self-initialization if done correctly.
I simply don't think it should be turned on by -Wall.
In the real world, an example along the line you gave above was
presented to me when someone -- actually Vincent Lefevre
<firstname.lastname@example.org> -- complained (loudly) on the French
speaking newsgroup news:fr.comp.lang.c about GCC giving bogus warning
for a perfectly valid program construct (I don't remember the exact
code, but it was about initializing variables based on some series of
As an aside, I'm a bit surprised to see that far more misleading
constructs should be warned about by GCC, but the corresponding flags
are not turned on by -Wall and yet nobody is arguing so strongly about
having them in -Wall. An example is -Wnested-externs.