This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: G++ preprocessor problem with unary ##
- To: Dave Martindale <davem at cs dot ubc dot ca>
- Subject: Re: G++ preprocessor problem with unary ##
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Tue, 20 Mar 2001 07:43:33 +0000
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <3.0.6.32.20010319230315.007b5610@mail.cs.ubc.ca>
Dave Martindale wrote:-
> I use a large C++ library called LEDA. It compiled and ran OK using
> g++ 2.95, but parts of it will not compile under 2.96. The problem is
> in the handling of a particular use of the "##" token pasting operator
> in the preprocessor. Here is a simplified example of the code that
> causes the problem:
This has come up before.
Simply deleting the ## should work. There is no such thing as unary ##;
just like there is no such thing as unary division :-) ## pastes two
surrounding tokens to form a single token; if it doesn't form a single
token it is an error in the source code.
Also, I don't recommend you use 2.96 for preprocessing, if you're
referring to early revisions of the RedHat release.
Have none of the people who have fixed LEDA sent their fixes upstream?
Neil.