Bug 9513 - warning: pasting "Tau2A" and ")" does not give a valid preprocessing token
Summary: warning: pasting "Tau2A" and ")" does not give a valid preprocessing token
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2003-01-30 19:46 UTC by mdoran
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
beta3.tar.gz (684.34 KB, application/x-gzip )
2003-05-21 15:17 UTC, mdoran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mdoran 2003-01-30 19:46:00 UTC
The following code gives the error message in Synopsis. This is part of a header file

#define CACHE(a)  if (a##X == tau) return a##Y; a##X = tau; return a##Y = (*a##)(tau)

inline double Cosmos::tau2a(const double tau)                {  CACHE(Tau2A); }

gcc-2.95 didn't report any warning. The code generated
by the pre-processor is perfectly fine. The warning is unnerving. Thanks!

Release:
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-i

Environment:
SusE Linux 8.1 , kernel 2.4.19

How-To-Repeat:
Is part of a rather larger build. I'll include the archive. But looking at the code in the description is propably much more easy.
Comment 1 Christian Ehrhardt 2003-02-02 09:31:21 UTC
State-Changed-From-To: open->closed
State-Changed-Why: The warning is perfectly legal. The result of a ## operator must be a
    valid preprocessor token. You are trying to paste the string tau2 with
    a closing parenthesis and the result isn't a preprocessor token. Remove
    the ## operator after *a to get rid of the warning.