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: RFC: -Wall by default


On 8 April 2012 19:51, Robert Dewar wrote:
> On 4/8/2012 1:56 PM, Jonathan Wakely wrote:
>>
>> ?The people who don't want -Wall (or
>> -Wstandard) enabled are likely to be the ones who know how to use
>> -Wno-all or whatever to get what they want.
>
>
> I see no evidence that supports that guess. On the contrary, I
> would guess that if -Wall is set by default, you will get lots
> of (probably invalid) complaints of the sort "why is gcc complaining
> at perfectly correct code", and of course in some cases those will
> be false positives, so they will be valid complaints.

Again, that also applies when people use -Wall today: a false positive
is unwanted even if you use -Wall, and those false positives are bugs
and so having them in bugzilla is good.  For the cases where the
warning is valid we're doing the user a service by showing or teaching
them that their code is problematic. Having to triage and close
invalid bug reports from those users may be a bit tedious but still
does them a service by encouraging them to improve their code.  So
there are positive aspects of both valid and invalid reports caused by
enabling -Wall

PR 51270 is just one example I happened across today where the
reporter says "constness violation is accepted without any warning"
then shows that g++ was being invoked without any warning options.  At
least some users expect to get warnings without having to request them
explicitly.  GCC doesn't tell you to use -Wall to get diagnostics that
weren't printed but could have been, whereas when a diagnostic is
issued the relevant option is shown. The option to suppress an
unwanted warning is arguably more discoverable than the option to
enable a warning that isn't being given.  (I say arguably, because you
have to know to say -Wno-xxx to suppress the warnings that print
-Wxxx)


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