One more difference between gcc's and MS preprocessor

Viewed 513

One more difference between gcc preprocessor and that of MS VS cl. Consider the following snippet:

# define A(x) L ## x
# define B A("b")
# define C(x) x
C(A("a" B))

For 'gcc -E' we get the following:

L"a" A("b")

For 'cl /E' the output is different:

L"a" L"b"

MS preprocessor somehow performs an additional macro expansion. Algorithm of its work is obviously different from that of gcc, but this algorithm also seems to be a secret. Does anyone know how the observed difference can be explained and what is the scheme of preprocessing in MS cl?

3 Answers
Related