public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* CPP preprocessor: #define-splitting?
@ 2004-08-26  6:46 Florian Stoehr
  2004-08-26  7:13 ` Eljay Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Stoehr @ 2004-08-26  6:46 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-08-26  7:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-26  6:46 CPP preprocessor: #define-splitting? Florian Stoehr
2004-08-26  7:13 ` Eljay Love-Jensen
2004-08-26 12:10   ` Florian Stoehr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).