Warnings in the C++ Front-End and GCC in General

Jeffrey A Law law@cygnus.com
Thu Sep 10 02:52:00 GMT 1998


  In message < Pine.LNX.3.96.980909122101.793G-100000@jinks.home >you write:
  > And I do select them: "-Wall -Wstrict-prototypes" provides the warnings
  > that are appropriate.
And what do you do if someone adds/deletes warnings from -Wall?  I 
guess you could define policy as no errors from -Wall, regardless of
what aspects of -Wall change over time.  I wouldn't recommend it, but
you could certainly make that policy :-)

  > I do share these values and I do find -Wall useful. However, some
  > (generally useful) warnings that -Wall enables do give false positives,
Yes.

  > for example -Wunitialised (in the egcs 1.0.3a meaning, not the broken one
  > in 1.1b). You do acknowledge this fact and agree that the situation should
  > be improved, don't you?
I agree that it can and should be improved.  Fixing the uninitialized
warnings is a hard problem though and has to be balanced with the many
other issues at hand for this project.

Contributions certainly speed up the process :-)

  > Another example, more GCC related: __attribute__((unused)). Clearly, it's
  > the same concept: being able to disable a warning for a particular case.
Actually I've been against those attributes from the start because of
the maintenance issues. :-)  I haven't pushed back hard on the unused
stuff because it doesn't have nearly the long term maintenance impact
as the fine grained warning stuff.

  > Now, what I'm asking for is just a natural extension of this idea: if GCC
  > provides means to disable some warnings on case-by-case basis, why not for
  > all of them?
Right.  And I think that's where things have gone too far.

  > > And yes, in my day job, I do deal with customers that requirewarning-
  > > less compilations out of gcc, as does Richard and everyone else in 
  > > Cygnus that's involved in gcc/g++ work.
  > 
  > And they don't come up with such ideas? I find it unbelievable. If people
  > offer you money and you still are so negative towards the idea, my hopes
  > of seeing such a feature in GCC are virtually gone :-(.
They usually come up with the idea, but they are not willing to pay
for the development and usually after thinking hard about the
maintenance consequences of such fine grained control of warnings,
they instead go fix their code to avoid the warnings in the first
place.

A note, Cygnus customers to not drive the egcs project.  Submissions
are evaluated on their technical merit, not whether or not they're
going to help or hurt Cygnus customers.

jeff



More information about the Gcc mailing list