1899 Two replacement lists are identical if and only if the preprocessing tokens in both have the same number, ordering, spelling, and white-space separation, where all white-space separations are considered identical.
1900
An identifier currently defined as an object-like macro shall not be
redefined by another
1901
Likewise, an identifier currently defined as a function-like macro
shall not be redefined by another
1902 There shall be white-space between the identifier and the replacement list in the definition of an object-like macro.
1903 If the identifier-list in the macro definition does not end with an ellipsis, the number of arguments (including those arguments consisting of no preprocessing tokens) in an invocation of a function-like macro shall equal the number of parameters in the macro definition.
1904
Otherwise, there shall be more arguments in the invocation than there
are parameters in the macro definition (excluding the
1905
There shall exist a
1906
The identifier
1907 A parameter identifier in a function-like macro shall be uniquely declared within its scope.
1908
The identifier immediately following the
1909 There is one name space for macro names.
1910 Any white-space characters preceding or following the replacement list of preprocessing tokens are not considered part of the replacement list for either form of macro.
1911
If a
1912 A preprocessing directive of the form
# define identifier replacement-list new-line
defines an object-like macro that causes each subsequent instance of the macro name146) to be replaced by the replacement list of preprocessing tokens that constitute the remainder of the directive.
1913 A preprocessing directive of the form
# define identifier lparen identifier-listopt ) replacement-list new-line # define identifier lparen ... ) replacement-list new-line # define identifier lparen identifier-list , ... ) replacement-list new-line
defines a function-like macro with arguments, similar syntactically to a function call.
1914
The parameters are specified by the optional list of identifiers,
whose scope extends from their declaration in the identifier list
until the new-line character that terminates the
1915
Each subsequent instance of the function-like macro name followed by
a
1916
The replaced sequence of preprocessing tokens is terminated by the
matching
1917 Within the sequence of preprocessing tokens making up an invocation of a function-like macro, new-line is considered a normal white-space character.
1918 The sequence of preprocessing tokens bounded by the outside-most matching parentheses forms the list of arguments for the function-like macro.
1919 The individual arguments within the list are separated by comma preprocessing tokens, but comma preprocessing tokens between matching inner parentheses do not separate arguments.
1920
If there are sequences of preprocessing tokens within the list of
arguments that would otherwise act as preprocessing
directives
1921
If there is a
1922
The number of arguments so combined is such that, following merger,
the number of arguments is one more than the number of parameters in
the macro definition (excluding the
1923 146) Since, by macro-replacement time, all character constants and string literals are preprocessing tokens, not sequences possibly containing identifier-like subsequences (see 5.1.1.2, translation phases), they are never scanned for macro names or parameters.
1924
Next
Created at: 2005-06-29 02:19:04
The text from WG14/N1124 is copyright © ISO