simplecpp
simplecpp copied to clipboard
Nested macros containing ## do not get expanded properly.
#define GETMYID(a) ((a))+1
#define FIGHT_FOO(c, ...) foo(c, ##__VA_ARGS__)
FIGHT_FOO(1, GETMYID(a));
The gcc -E says:
foo(1, ((a))+1);
And simplecpp says:
foo ( 1 , GETMYID ( a ) ) ;
For your information.. please always indent all code with 4 spaces. Then github will understand it's code. it will look better and it avoids that code are interpreted as formatting.
Thanks, not used to github posting too much :). Apologies for the hassle!
That seems to be a compiler specific extension to the concatenation operator, see http://en.cppreference.com/w/cpp/preprocessor/replace#.23_and_.23.23_operators