Jeff Law <l...@redhat.com> writes:

> On 07/10/2013 04:51 AM, Andreas Arnez wrote:
>> OK, I may be biased, because I have *only* seen false positives with
>> this warning so far.  Others may have made better experience with it.
> It's found numerous bugs across many projects.  The reduction in bug
> reports against GCC which turn out to be uninitialized variables in
> the user's code has dropped dramatically over the last decade (if only
> the same could be said for user malloc errors reported against glibc
> :(

Interesting.  Upstream GCC seems to have added this option to -Wall on
April 26th in 2011.  Have those projects been using the option
explicitly before?

> What you're seeing may be an indication that most of the real bugs
> have been found & squashed and what remains may be mostly false
> positives.

Actually, I believe most of the "maybe uninitialized" false positives I
saw were with code that hasn't been touched since many years.  They
suddenly appeared due to the introduction of this option in "-Wall" or
due to regressions in GCC.

>> My understanding of -Wall (so far) was that it shouldn't include
>> warnings with false positives.
> No, that's not true at all.  -Wall is a set of warnings that the GCC
> developers have found useful over time and strive to avoid triggering
> in our own code.  We've also seen that -Wall maps reasonably well to
> problems other projects want to fix in their own code.
>
> We certainly evaluate whether or not the warning generates too many
> false positives when we decide whether or not to include it in
> -Wall. However, we certainly allow warnings which generate false
> positives to be in -Wall.

Then maybe that's what should be documented for "-Wall" instead of the
current (misleading) description.  Particuarly I suggest to add a
disclaimer about possible false positives, and to remove the "easy to
avoid".  So instead of this:

  This enables all the warnings about constructions that some users
  consider questionable, and that are easy to avoid (or modify to
  prevent the warning), even in conjunction with macros.

Maybe more something like this:

  This enables all the warnings about constructions that GCC developers
  consider questionable, or which GCC isn't sure about whether they
  might be questionable.

Reply via email to