On 09/02/2016 05:13 PM, Marek Polacek wrote:
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi index 87da1f1..38d55d4 100644 --- gcc/doc/invoke.texi +++ gcc/doc/invoke.texi @@ -5437,8 +5437,8 @@ if (a < 0 && a < 0) @{ @dots{} @} @opindex Wlogical-not-parentheses @opindex Wno-logical-not-parentheses Warn about logical not used on the left hand side operand of a comparison. -This option does not warn if the RHS operand is of a boolean type. Its -purpose is to detect suspicious code like the following: +This option does not warn if the right operand is considered to be a Boolean +expression. Its purpose is to detect suspicious code like the following:
I think "Boolean" shouldn't be capitalized. The patch looks ok to me otherwise.
+ r += !a == (b | c);
I do wonder whether we should give a different warning for this though. I personally prefer code involving bools to use || to show it's a logical operation. Bit-wise may indicate mistakes where the programmer thought he was operating on integers.
Bernd