This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30348] New: '#define false FALSE' undefines '#define FALSE false'
- From: "h8_spam at sonic dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jan 2007 22:10:16 -0000
- Subject: [Bug c++/30348] New: '#define false FALSE' undefines '#define FALSE false'
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I ran into an issue where doing #define FALSE false followed by #define false
FALSE undefined the first FALSE which is not what I would expect.
Perhaps this is part of the standard, but in case not, I'm reporting it.
---------------------------------------------------------------------------
#define FALSE false
#define TRUE true
#ifndef true
#define true TRUE
#endif
#ifndef false
#define false FALSE
#endif
main() {
bool test1 = FALSE;
bool test2 = TRUE;
}
----------------------------------------------------------------------------
[envy viewer] g++ test.cc
test.cc: In function `int main()':
test.cc:13: error: `FALSE' undeclared (first use this function)
test.cc:13: error: (Each undeclared identifier is reported only once for each
function it appears in.)
test.cc:14: error: `TRUE' undeclared (first use this function)
--
Summary: '#define false FALSE' undefines '#define FALSE false'
Product: gcc
Version: 3.3.6
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: h8_spam at sonic dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30348