1851 The expression that controls conditional inclusion shall be an integer constant expression except that: it shall not contain a cast;
1852 it shall not contain a cast;
1853 identifiers (including those lexically identical to keywords) are interpreted as described below;141)
1854 and it may contain unary operator expressions of the form
defined identifier
or
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
1855 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.
1856 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.
1857
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
1858
If the token
1859
After all replacements due to macro expansion and the
1860
The resulting tokens compose the controlling constant expression
which is evaluated according to the rules of 6.6
1861
1862 This includes interpreting character constants, which may involve converting escape sequences into execution character set members.
1863
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
1864 Also, whether a single-character character constant may have a negative value is implementation-defined.
1865 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.
1866
Their conditions are equivalent to
1867
1868
143) Thus, the constant expression in the following
#if 'z' - 'a' == 25
if ('z' - 'a' == 25)
1869 Each directive's condition is checked in order.
1870 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;
1871 directives are processed only through the name that determines the directive in order to keep track of the level of nested conditionals;
1872 the rest of the directives' preprocessing tokens are ignored, as are the other preprocessing tokens in the group.
1873 Only the first group whose control condition evaluates to true (nonzero) is processed.
1874
If none of the conditions evaluates to true, and there is a
1875
lacking a
1876 Forward references: macro replacement (6.10.3), source file inclusion (6.10.2), largest integer types (7.18.1.5).
Next
Created at: 2005-06-29 02:19:04
The text from WG14/N1124 is copyright © ISO