Previous Table of Contents "New C Standard" commentary
If, in the replacement list of a function-like macro, a parameter is
immediately preceded or followed by a
1960 however, if an argument consists of no preprocessing tokens, the parameter is replaced by a placemarker preprocessing token instead.148)
For both object-like and function-like macro invocations, before the
replacement list is reexamined for more macro names to replace, each
instance of a
1962 Placemarker preprocessing tokens are handled specially: concatenation of two placemarkers results in a single placemarker preprocessing token, and concatenation of a placemarker with a non-placemarker preprocessing token results in the non-placemarker preprocessing token.
1963 If the result is not a valid preprocessing token, the behavior is undefined.
1964 The resulting token is available for further macro replacement.
The order of evaluation of
1966 EXAMPLE In the following fragment:
#define hash_hash # ## # #define mkstr(a) # a #define in_between(a) mkstr(a) #define join(c, d) in_between(c hash_hash d) char p = join(x, y); // equivalent to // char p = "x ## y"
The expansion produces, at various stages:
join(x, y) in_between(x hash_hash y) in_between(x ## y) mkstr(x ## y) "x ## y"
In other words, expanding
1967 148) Placemarker preprocessing tokens do not appear in the syntax because they are temporary entities that exist only within translation phase 4.
Created at: 2008-01-30 02:39:45
The text from WG14/N1256 is copyright © ISO
Created at: 2008-01-30 02:39:45 The text from WG14/N1256 is copyright © ISO