-Wparentheses lumps too much together

Ian Lance Taylor iant@google.com
Thu Dec 20 18:01:00 GMT 2007


"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



More information about the Gcc mailing list