This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61534] New: Wlogical-op should not warn when either operand comes from macro expansion
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Jun 2014 10:25:10 +0000
- Subject: [Bug c/61534] New: Wlogical-op should not warn when either operand comes from macro expansion
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61534
Bug ID: 61534
Summary: Wlogical-op should not warn when either operand comes
from macro expansion
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: manu at gcc dot gnu.org
#define DEFINED (x != 0)
int foo(int x)
{
if (!DEFINED && x != 0) return 0;
return 1;
}
manuel@gcc10:~$ ~/test1/210581/build/gcc/cc1 -Wlogical-op test.c
foo
test.c: In function âfooâ:
test.c:5:16: warning: logical âandâ of mutually exclusive tests is always false
[-Wlogical-op]
if (!DEFINED && x != 0) return 0;
^
Clang does not warn. This was the reason -Wlogical-op was moved out of -Wextra
(PR40172).