This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 3.1 preprocessor regression?
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: "J.T. Conklin" <jtc at acorntoolworks dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 17 May 2002 07:08:14 +0100
- Subject: Re: 3.1 preprocessor regression?
- References: <87offfk39t.fsf@orac.acorntoolworks.com>
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.