Previous Table of Contents "New C Standard" commentary
1869 The expression that controls conditional inclusion shall be an integer constant expression except that: it shall not contain a cast;
1870 it shall not contain a cast;
1871 identifiers (including those lexically identical to keywords) are interpreted as described below;141)
1872 and it may contain unary operator expressions of the form
defined ( identifier )
which evaluate to 1 if the identifier is currently defined as a macro
name (that is, if it is predefined or if it has been the subject of a
1874 141) Because the controlling constant expression is evaluated during translation phase 4, all identifiers either are or are not macro names there simply are no keywords, enumeration constants, etc.
1875 Preprocessing directives of the forms
# if constant-expression new-line groupopt # elif constant-expression new-line groupopt
check whether the controlling constant expression evaluates to nonzero.
Prior to evaluation, macro invocations in the list of preprocessing
tokens that will become the controlling constant expression are
replaced (except for those macro names modified by the
If the token
After all replacements due to macro expansion and the
The resulting tokens compose the controlling constant expression
which is evaluated according to the rules of 6.6
1881 This includes interpreting character constants, which may involve converting escape sequences into execution character set members.
Whether the numeric value for these character constants matches the
value obtained when an identical character constant occurs in an
expression (other than within a
1883 Also, whether a single-character character constant may have a negative value is implementation-defined.
1884 Preprocessing directives of the forms
# ifdef identifier new-line groupopt # ifndef identifier new-line groupopt
check whether the identifier is or is not currently defined as a macro name.
Their conditions are equivalent to
143) Thus, the constant expression in the following
#if 'z' - 'a' == 25 if ('z' - 'a' == 25)
1888 Each directive's condition is checked in order.
1889 If it evaluates to false (zero), the group that it controls is skipped: directives are processed only through the name that determines the directive in order to keep track of the level of nested conditionals;
1890 directives are processed only through the name that determines the directive in order to keep track of the level of nested conditionals;
1891 the rest of the directives' preprocessing tokens are ignored, as are the other preprocessing tokens in the group.
1892 Only the first group whose control condition evaluates to true (nonzero) is processed.
If none of the conditions evaluates to true, and there is a
1895 Forward references: macro replacement (6.10.3), source file inclusion (6.10.2), largest integer types (188.8.131.52).
Created at: 2008-01-30 02:39:44
The text from WG14/N1256 is copyright © ISO
Created at: 2008-01-30 02:39:44 The text from WG14/N1256 is copyright © ISO