This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
preprocessor in ss-20000724 fumbles arglist expansion
- To: gcc-bugs at gcc dot gnu dot org
- Subject: preprocessor in ss-20000724 fumbles arglist expansion
- From: "Thomas R. Truscott" <trt at cs dot duke dot edu>
- Date: Thu, 27 Jul 2000 13:01:21 -0400 (EDT)
[This seems to be a new problem, it was okay in ss-20000703]
When gcc compiles the following:
#define SYMBOL_COMMA ,
#define ECHO(x) x
#define GENERATE(sym) ECHO(SYMBOL_##sym)
int x GENERATE(COMMA) y;
the preprocessor says 'too many arguments for macro "ECHO"'
(This is the preprocessor used by gcc for default compilations,
which in the gcc source directory is named "cpp"
and not "xcpp" or "tradcpp". On Linux this binary
is in .../lib/gcc-lib/i686-pc-linux/2.96/cpp and not bin/cpp.
I find this quite confusing. Anyway,
doing "gcc -c foo.c" on the above code is simplest.)
The correct behavior is to produce "int x , y;" without complaint.
Tom Truscott