[Bug c/80085] New: missing -Wlogical-op on a superfluous second operand of &&
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 17 15:44:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80085
Bug ID: 80085
Summary: missing -Wlogical-op on a superfluous second operand
of &&
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
The test case below, reduced from bug 80050 in GCC sources, shows a case of a
missing -Wlogical-op warning for the second operand of the && expression which
is trivially satisfied by the first operand.
$ cat u.c && gcc -S -Wall -Wextra -Wpedantic -Wlogical-op u.c
int f (int i)
{
if (i == 123 && i != 456)
return 1;
return 2;
}
More information about the Gcc-bugs
mailing list