This is the mail archive of the gcc@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: 3.1 preprocessor regression?


J.T. Conklin wrote:-

> I read the preprocessor section of the C9X standard, and I think what
> I want to do is valid.  As I read 6.10.3.3, when the anglequote macro
> is expanded, both ## operators should be replaced before the macro is
> rexamined for further expansion.  So it shouldn't matter that "<stdio"
> and "h>" are not valid preprocessor tokens, as <stdio.h> is.  Perhaps
> I'm all wet though.  Knowing that would be useful too...

The ## operator concatenates two pptokens to become one pptoken.
The standard says that if the concatenated form is not a pptoken,
the behaviour is undefined.

Whether later ## would form a pptoken is irrelevant (and not in
fact the case even in your example, as there is an intervening
period).

As Zack and Robert said, just get rid of the pointless use of ##.

Neil.


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