[C/C++ PATCH] Further -Wlogical-not-parentheses improvement (PR c/65120)

2015-03-09 Thread Jakub Jelinek
Hi! As mentioned by richi, !x == 0 is actually equivalent to !(x == 0) and x != 0 and !x != 0 is equivalent to !(x != 0) and x == 0, so this patch adjusts the warning not to warn in that case, as adding parens doesn't change anything. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for

Re: [C/C++ PATCH] Further -Wlogical-not-parentheses improvement (PR c/65120)

2015-03-09 Thread Jeff Law
On 03/09/15 15:26, Jakub Jelinek wrote: Hi! As mentioned by richi, !x == 0 is actually equivalent to !(x == 0) and x != 0 and !x != 0 is equivalent to !(x != 0) and x == 0, so this patch adjusts the warning not to warn in that case, as adding parens doesn't change anything.

Re: [C/C++ PATCH] Further -Wlogical-not-parentheses improvement (PR c/65120)

2015-03-09 Thread Joseph Myers
On Mon, 9 Mar 2015, Jakub Jelinek wrote: Hi! As mentioned by richi, !x == 0 is actually equivalent to !(x == 0) and x != 0 and !x != 0 is equivalent to !(x != 0) and x == 0, so this patch adjusts the warning not to warn in that case, as adding parens doesn't change anything.