This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CPP preprocessor: #define-splitting?


On Wed, 25 Aug 2004, Eljay Love-Jensen wrote:

> Hi Florian,
>
> The # is a preprocessor directive.
>
> The X is not a preprocessor directive.
>
> The rules for parsing preprocessor directives is different form the rules
> for parsing non-preprocessor directives.  (The state machine is in a
> different state.)
>
> HTH,
> --Eljay
>
>

Hi,

thanks for the reply. But there seems to happen something strange BEFORE
the preprocessing itself (in comment remove stage?).

Why am I allowed to do a...

# /*
*/ define

and a

#
 define

not? I thought the stage where it strips out comments comes before the
"main" preprocessor where it scans for #-directives. so why is the #
define allowed to be split on multiple lines WITHOUT a backslash-newline?

afaik, any comment gets replaced by a single " " and every newline inside
the comment gets added AFTER the comment.

so the

# /*
*/ define

should become a

#
 define

after the comment removing stage - but this does not work see above.

(just confused wheter it does something special with comments "inside" a
#-directive)

-Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]