This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/80085] New: missing -Wlogical-op on a superfluous second operand of &&
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Mar 2017 15:44:54 +0000
- Subject: [Bug c/80085] New: missing -Wlogical-op on a superfluous second operand of &&
- Auto-submitted: auto-generated
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;
}