This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Implement warning for wrong use of ||/&&
On Tuesday, 13. February 2007 00:20, Manuel López-Ibáñez wrote:
> No, please, don't do this. Walways-true warnings have nothing to do
> with this (the name is wrong wrong wrong, this is the same mistake
> that was done with Wconversion, but worse because this time the
> description of Walways-true is also wrong, so please let's not repeat
> it again).
Well, the description of -Walways-true is certainly suboptimal, yes, because
it references to an example that certainly does not trigger
under -Walways-true. However, I think it is the one that comes closest to the
spirit of it. If you can suggest a new name, I'm perfectly fine with adding
yet another warning option for this one. I was just saying that it is low
false-positive and therefore imho doesn't hurt to be in -Wall.
> And I cannot understand how you were able to bootstrapped this if it
> emits warnings for GCC code.
I submitted the patches for that beforehand ;)
> PS: I think there are already warnings for wrong usage of || and &&
> somewhere. If you don't want to bother, I would like the patch to be
> hold until I can look them up.
Sure, please have a look. The only thing that comes to my mind
is -Wparentheses warning about expressions which include || and && without
explicit precedence.
Dirk