This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
CPP preprocessor: #define-splitting?
- From: Florian Stoehr <netbsd at wolfnode dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 26 Aug 2004 00:06:37 +0200 (CEST)
- Subject: CPP preprocessor: #define-splitting?
Hi,
I'm developing a gcc-compatible preprocessor for a compiler project. While
doing this, I discovered something strange.
In preprocessor documentation:
/\
*
*/ # /*
*/ defi\
ne FO\
O 10\
20
will expand to "#define FOO 1020". It does.
But:
# /*
*/ define TEST "foo"
--> #define TEST "foo"
Replacing the "#" by an "X" will produce with gcc -E:
X
define TEST "foo"
_BUT_:
#
define TEST "foo"
--> TEST doen't get defined.
The problem is: Why does it recognize the "#" and "define" splitted by a
multi-line comment as "#define"? Is this the correct behaviour?
Thanks for your help
Florian