preprocessor in ss-20000724 fumbles arglist expansion
Thomas R. Truscott
trt@cs.duke.edu
Thu Jul 27 10:01:00 GMT 2000
[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
More information about the Gcc-bugs
mailing list