6.10.3.2 The # operator

Previous Table of Contents "New C Standard" commentary

1950 Each # preprocessing token in the replacement list for a function-like macro shall be followed by a parameter as the next preprocessing token in the replacement list.

1951 If, in the replacement list, a parameter is immediately preceded by a # preprocessing token, both are replaced by a single character string literal preprocessing token that contains the spelling of the preprocessing token sequence for the corresponding argument.

1952 Each occurrence of white space between the argument's preprocessing tokens becomes a single space character in the character string literal.

1953 White space before the first preprocessing token and after the last preprocessing token composing the argument is deleted.

1954 Otherwise, the original spelling of each preprocessing token in the argument is retained in the character string literal, except for special handling for producing the spelling of string literals and character constants: a \ character is inserted before each " and \ character of a character constant or string literal (including the delimiting " characters), except that it is implementation-defined whether a \ character is inserted before the \ character beginning a universal character name.

1955 If the replacement that results is not a valid character string literal, the behavior is undefined.

1956 The character string literal corresponding to an empty argument is "".

1957 The order of evaluation of # and ## operators is unspecified.

Next

Created at: 2008-01-30 02:39:45 The text from WG14/N1256 is copyright © ISO