This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30348] '#define false FALSE' undefines '#define FALSE false'
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2007 12:05:24 -0000
- Subject: [Bug c++/30348] '#define false FALSE' undefines '#define FALSE false'
- References: <bug-30348-11590@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from gdr at integrable-solutions dot net 2007-01-02 12:05 -------
Subject: Re: '#define false FALSE' undefines '#define FALSE false'
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Comment #1 from pinskia at gcc dot gnu dot org 2007-01-01 22:34
-------
| so what is happening here is the following:
|
| #define FALSE false
| #define false FALSE
|
| bool a = FALSE;
|
| So we get again:
| bool a = FALSE;
|
|
| This is the same problem as:
| int b;
|
| #define a b
| #define b a
|
| int main() {
| int test2 = a;
| }
|
| also true/false are not defined in C++ but rather they are keywords
`true' and `false' have special meanings, in C++, during
pre-processing phases. They can be used in the condition for
conditional inclusion, for example. Consequently, I don't think it is
valid to
#define false something
just like
#define 0 something
would be invalid.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30348