I am trying to understand the requirement of a C ++ standard preprocessor. The slightly complex example that I created causes unexpected results in GCC and VC ++ 2010:
GCC gives:
tzs W
Note the extra space added before W.
VC ++ 2010 gives:
tzsW
Note that no space is added to W, but the identifier does not expand. I looked at the C ++ 03 standard and cannot find anything saying that we must prevent the creation of a new identifier ( tzsW ), as in gcc. And it costs nothing to prevent this new identifier from further expanding macros (VC ++ behavior).
Why don't GCC and VC ++ 2010 like the new identifier?
EDIT
if another macro use is used, for example
a(t,zs )[]
gcc gives:
tzs[]
Notice that a space has been added, showing that gcc intentionally adds space to my previous case.
c ++ gcc c-preprocessor visual-c ++
Javaman
source share