This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a warning to implement


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
<vincent+news@vinc17.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
conditions). 

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.  

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]