I am trying to understand the C++ standard preprocessor requirement. A little bit tricky example I created has surprising results in GCC and VC++2010:
#define a(x,y) x##y
#define tzsW kka
a(t,zs )W
GCC yields:
tzs W
Note the extra space added before W.
VC++2010 yields:
tzsW
Note there is no space added before W but the identifier is not further expanded. I scanned through the C++03 standard and cannot find anything saying we should prevent a new identifier (tzsW
) from being created as in gcc. And nothing is about preventing this new identifier from further macro expanded (VC++ behaviour).
Why GCC and VC++2010 don't like the new identifier?
EDIT
if another macro invocation used, e.g.
a(t,zs )[]
gcc yields:
tzs[]
Note no space added, showing gcc deliberately adds space to my previous case.