On 04/21/2015 05:16 AM, Marek Polacek wrote:
This patch improves -Wlogical-op so that it also warns about cases such as
P && P or P || P. I made use of what merge_ranges computes: if we have equal
operands with the same ranges, warn -- that seems to work well.
(-Wlogical-op still isn't enabled neither by -Wall nor by -Wextra.)
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2015-04-21 Marek Polacek <pola...@redhat.com>
PR c/63357
* c-common.c (warn_logical_operator): Warn if the operands have the
same expressions.
* doc/invoke.texi: Update description of -Wlogical-op.
* c-c++-common/Wlogical-op-1.c: New test.
OK.
jeff