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. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2015-03-09 Jakub Jelinek <ja...@redhat.com> > > PR c/65120 > * c-common.c (warn_logical_not_parentheses): Don't warn for > !x == 0 or !x != 0. > > * c-typeck.c (parser_build_binary_op): Check for tcc_comparison > before preparing arguments to warn_logical_not_parentheses.
The C front-end changes are OK. -- Joseph S. Myers jos...@codesourcery.com