This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/22168] New: #if #A == #B should have a diagnostic
- From: "geoffk at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2005 02:04:07 -0000
- Subject: [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCC quietly accepts the following:
#define A a
#define B a
#if #A == #B
#endif
but it should not, because '#A == #B' is not an integer constant expression, see C99 section 6.10.1
paragraph 1. GCC does properly diagnose
#if "a" == "a"
--
Summary: #if #A == #B should have a diagnostic
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: geoffk at gcc dot gnu dot org
CC: dje at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot
org
GCC build triplet: *
GCC host triplet: *-*-*
GCC target triplet: *
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22168