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: -Wparentheses lumps too much together


"James K. Lowden" <jklowden@freetds.org> writes:

> > That particular warning happened to find dozens of real errors when I
> > ran it over a large code base.  It may be noise for you, but I know
> > from personal experience that it is very useful.
> 
> I would like to hear more about that, if you wouldn't mind.  I'm really
> quite surprised.  Honestly.  

I'm not free to share actual details, and I don't have the real
percentages anyhow.

The warning triggered many false positives.  But there were also a
number of true positives, far more than I expected.

A typical true positive looked more or less like

    if (a &&
        b || c)

often with a more complex condition.  The indentation would express
the intent, so it was easy to read the code and assume that it meant
what it appeared to mean.  But, of course, it didn't.

Ian


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