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 04/05/2012 01:28 PM, Michael Veksler wrote:

> As for specific warnings, I hate that the the code (a&&b || c&&d),
> which did not cause a warning on older gcc version now gives a
> warning. I would not want it on by default since it forces users to
> write too many parentheses in ((a&&b)||(c&&d)) which makes the
> expression less readable. What next? Warn about (a*b+c*d) ? I would
> hate to write ((a*b)+(c*d)).
> 
> Sure, the precedence of: << vs. +; & vs. == ; & vs. && ; is less
> clear and deserves a warning, but: & vs. | ; && vs. || ; are at
> least as common as * vs. + that programmers ought to know them.

Absolutely so, yes.  I'd consider this a bug in gcc, just as if it
warned for arithmetic.

Andrew.


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