CPP preprocessor: #define-splitting?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux