Macro expansion bug in gcc?
Neil Booth
NeilB@earthling.net
Mon Jun 19 05:54:00 GMT 2000
The following test case appears as gcc.dg/200000209-2.c
#define NO_PAREN(rest...) rest
#define DEFINE_CATEGORY(category, items) \
const int _nl_value_type_##category[] = { NO_PAREN items }
DEFINE_CATEGORY
(
LC_COLLATE,
(
1,
2,
3,
));
Current gcc outputs (modulo new lines)
const int _nl_value_type_LC_COLLATE [] = { 1, 2, 3, } ;
A new macro expander I'm trying out gives:-
const int _nl_value_type_LC_COLLATE[] = { NO_PAREN ( 1, 2, 3, ) };
I believe that current gcc is wrong and that the new code is right.
Would someone agree or disagree?
Thanks,
Neil.
More information about the Gcc-bugs
mailing list