From 64ee437a499e51415f53367a1c0be1c371b298d1 Mon Sep 17 00:00:00 2001 From: nsz Date: Thu, 21 Jul 2011 20:14:04 +0200 Subject: [PATCH] manual fix of section c99 6 --- ann2html.sh | 2 +- n1256.html | 376 ++++++++++++++++++++++++++-------------------------- 2 files changed, 190 insertions(+), 188 deletions(-) diff --git a/ann2html.sh b/ann2html.sh index 6950da2..ecb0411 100755 --- a/ann2html.sh +++ b/ann2html.sh @@ -161,7 +161,7 @@ seencontents && !seenfore && /^[^@]/ { next } -/^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns)$/ { +/^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits)$/ { ss[sid] = ss[sid] "
" $0 "
\n" next } diff --git a/n1256.html b/n1256.html index 20d4e73..7be4916 100644 --- a/n1256.html +++ b/n1256.html @@ -1721,7 +1721,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 DBL_MIN 1E-37 LDBL_MIN 1E-37 - Recommended practice +
Recommended practice

Conversion from (at least) double to decimal with DECIMAL_DIG digits and back should be the identity function. @@ -1832,7 +1832,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 definitions are listed on separate lines, except when prefaced by the words ''one of''. An optional symbol is indicated by the subscript ''opt'', so that

-          { expressionopt }
+ { expressionopt } indicates an optional expression enclosed in braces.

When syntactic categories are referred to in the main text, they are not italicized and @@ -2292,11 +2292,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 represented by successive bits are additive, begin with 1, and are multiplied by successive integral powers of 2, except perhaps the bit with the highest position. (Adapted from the American National Dictionary for Information Processing Systems.) A byte contains CHAR_BIT bits, and the values of - type unsigned char range from 0 to 2 - -

-                                           CHAR_BIT
-                                                     - 1.
+ type unsigned char range from 0 to 2CHAR_BIT- 1.

41) Thus, an automatic variable can be initialized to a trap representation without causing undefined behavior, but the value of the variable cannot be used until a proper value is stored in it. @@ -2315,8 +2311,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 For unsigned integer types other than unsigned char, the bits of the object representation shall be divided into two groups: value bits and padding bits (there need not be any of the latter). If there are N value bits, each bit shall represent a different - power of 2 between 1 and 2 N -1 , so that objects of that type shall be capable of - representing values from 0 to 2 N - 1 using a pure binary representation; this shall be + power of 2 between 1 and 2N-1 , so that objects of that type shall be capable of + representing values from 0 to 2N - 1 using a pure binary representation; this shall be known as the value representation. The values of any padding bits are unspecified.44)

For signed integer types, the bits of the object representation shall be divided into three @@ -2330,8 +2326,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 modified in one of the following ways:

Which of these applies is implementation-defined, as is whether the value with sign bit 1 and all value bits zero (for the first two), or with sign bit and all value bits 1 (for ones' @@ -2583,32 +2579,35 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 and complex otherwise. This pattern is called the usual arithmetic conversions:

-

-       First, if the corresponding real type of either operand is long double, the other
+
    +
  • First, if the corresponding real type of either operand is long double, the other operand is converted, without change of type domain, to a type whose corresponding real type is long double. - Otherwise, if the corresponding real type of either operand is double, the other +
  • Otherwise, if the corresponding real type of either operand is double, the other operand is converted, without change of type domain, to a type whose corresponding real type is double. - Otherwise, if the corresponding real type of either operand is float, the other +
  • Otherwise, if the corresponding real type of either operand is float, the other operand is converted, without change of type domain, to a type whose corresponding real type is float.51) - Otherwise, the integer promotions are performed on both operands. Then the +
  • Otherwise, the integer promotions are performed on both operands. Then the following rules are applied to the promoted operands: - If both operands have the same type, then no further conversion is needed. - Otherwise, if both operands have signed integer types or both have unsigned +
      +
    • If both operands have the same type, then no further conversion is needed. +
    • Otherwise, if both operands have signed integer types or both have unsigned integer types, the operand with the type of lesser integer conversion rank is converted to the type of the operand with greater rank. - Otherwise, if the operand that has unsigned integer type has rank greater or +
    • Otherwise, if the operand that has unsigned integer type has rank greater or equal to the rank of the type of the other operand, then the operand with signed integer type is converted to the type of the operand with unsigned integer type. - Otherwise, if the type of the operand with signed integer type can represent +
    • Otherwise, if the type of the operand with signed integer type can represent all of the values of the type of the operand with unsigned integer type, then the operand with unsigned integer type is converted to the type of the operand with signed integer type. - Otherwise, both operands are converted to the unsigned integer type - corresponding to the type of the operand with signed integer type.
+
  • Otherwise, both operands are converted to the unsigned integer type + corresponding to the type of the operand with signed integer type. + + The values of floating operands and of the results of floating expressions may be represented in greater precision and range than that required by the type; the types are not changed thereby.52) @@ -2883,7 +2882,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 - Implementation limits +
    Implementation limits

    As discussed in 5.2.4.1, an implementation may limit the number of significant initial characters in an identifier; the limit for an external name (an identifier that has external @@ -3001,9 +3000,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               integer-constant:
    -                  decimal-constant integer-suffixopt
    -                  octal-constant integer-suffixopt
    -                  hexadecimal-constant integer-suffixopt
    +                  decimal-constant integer-suffixopt
    +                  octal-constant integer-suffixopt
    +                  hexadecimal-constant integer-suffixopt
               decimal-constant:
                     nonzero-digit
                     decimal-constant digit
    @@ -3024,10 +3023,10 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                   a b c           d e      f
                   A B C           D E      F
             integer-suffix:
    -                unsigned-suffix long-suffixopt
    +                unsigned-suffix long-suffixopt
                     unsigned-suffix long-long-suffix
    -                long-suffix unsigned-suffixopt
    -                long-long-suffix unsigned-suffixopt
    +                long-suffix unsigned-suffixopt
    +                long-long-suffix unsigned-suffixopt
             unsigned-suffix: one of
                    u U
             long-suffix: one of
    @@ -3052,38 +3051,45 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The type of an integer constant is the first of the corresponding list in which its value can
      be represented.
     
    -
    -                                                                  Octal or Hexadecimal
    - Suffix Decimal Constant Constant - - none int int -
    -                     long int                               unsigned int
    -                     long long int                          long int
    -                                                            unsigned long int
    -                                                            long long int
    -                                                            unsigned long long int
    - - u or U unsigned int unsigned int -
    -                     unsigned long int                      unsigned long int
    -                     unsigned long long int                 unsigned long long int
    - - l or L long int long int -
    -                     long long int                          unsigned long int
    -                                                            long long int
    -                                                            unsigned long long int
    - - Both u or U unsigned long int unsigned long int - and l or L unsigned long long int unsigned long long int - - ll or LL long long int long long int -
    -                                                            unsigned long long int
    - - Both u or U unsigned long long int unsigned long long int - and ll or LL + +
    Suffix Decimal Constant Octal or Hexadecimal Constant +
    none +
    int
    +long int
    +long long int
    +
    int
    +unsigned int
    +long int
    +unsigned long int
    +long long int
    +unsigned long long int
    +
    u or U +
    unsigned int
    +unsigned long int
    +unsigned long long int
    +
    unsigned int
    +unsigned long int
    +unsigned long long int
    +
    l or L +
    long int
    +long long int
    +
    long int
    +unsigned long int
    +long long int
    +unsigned long long int
    +
    Both u or U and l or L +
    unsigned long int
    +unsigned long long int
    +
    unsigned long int
    +unsigned long long int
    +
    ll or LL +
    long long int
    +
    long long int
    +unsigned long long int
    +
    Both u or U and ll or LL +
    unsigned long long int
    +
    unsigned long long int
    +

    If an integer constant cannot be represented by any type in its list, it may have an extended integer type, if the extended integer type can represent its value. If all of the @@ -3103,31 +3109,31 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 decimal-floating-constant hexadecimal-floating-constant decimal-floating-constant: - fractional-constant exponent-partopt floating-suffixopt - digit-sequence exponent-part floating-suffixopt + fractional-constant exponent-partopt floating-suffixopt + digit-sequence exponent-part floating-suffixopt hexadecimal-floating-constant: hexadecimal-prefix hexadecimal-fractional-constant - binary-exponent-part floating-suffixopt + binary-exponent-part floating-suffixopt hexadecimal-prefix hexadecimal-digit-sequence - binary-exponent-part floating-suffixopt + binary-exponent-part floating-suffixopt fractional-constant: - digit-sequenceopt . digit-sequence + digit-sequenceopt . digit-sequence digit-sequence . exponent-part: - e signopt digit-sequence - E signopt digit-sequence + e signopt digit-sequence + E signopt digit-sequence sign: one of + - digit-sequence: digit digit-sequence digit hexadecimal-fractional-constant: - hexadecimal-digit-sequenceopt . + hexadecimal-digit-sequenceopt . hexadecimal-digit-sequence hexadecimal-digit-sequence . binary-exponent-part: - p signopt digit-sequence - P signopt digit-sequence + p signopt digit-sequence + P signopt digit-sequence hexadecimal-digit-sequence: hexadecimal-digit hexadecimal-digit-sequence hexadecimal-digit @@ -3161,7 +3167,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Floating constants are converted to internal format as if at translation-time. The conversion of a floating constant shall not raise an exceptional condition or a floating- point exception at execution time. - Recommended practice +

    Recommended practice

    The implementation should produce a diagnostic message if a hexadecimal constant cannot be represented exactly in its evaluation format; the implementation should then @@ -3330,8 +3336,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               string-literal:
    -                  " s-char-sequenceopt "
    -                  L" s-char-sequenceopt "
    +                  " s-char-sequenceopt "
    +                  L" s-char-sequenceopt "
               s-char-sequence:
                      s-char
                      s-char-sequence s-char
    @@ -3619,8 +3625,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
     
                 i = ++i + 1;
    -            a[i++] = i;
    +            a[i++] = i;
    while allowing +
                 i = i + 1;
                 a[i] = i;
    @@ -3633,9 +3640,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 parentheses () (6.5.1), subscripting brackets [] (6.5.2.1), function-call parentheses () (6.5.2.2), and the conditional operator ?: (6.5.15). -
    -    Within each major subclause, the operators have the same precedence. Left- or right-associativity is
    -    indicated in each subclause by the syntax for the expressions discussed therein.
    + Within each major subclause, the operators have the same precedence. Left- or right-associativity is + indicated in each subclause by the syntax for the expressions discussed therein.

    75) Allocated objects have no declared type. @@ -4981,12 +4987,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               declaration:
    -                 declaration-specifiers init-declarator-listopt ;
    +                 declaration-specifiers init-declarator-listopt ;
               declaration-specifiers:
    -                 storage-class-specifier declaration-specifiersopt
    -                 type-specifier declaration-specifiersopt
    -                 type-qualifier declaration-specifiersopt
    -                 function-specifier declaration-specifiersopt
    +                 storage-class-specifier declaration-specifiersopt
    +                 type-specifier declaration-specifiersopt
    +                 type-qualifier declaration-specifiersopt
    +                 function-specifier declaration-specifiersopt
               init-declarator-list:
                       init-declarator
                       init-declarator-list , init-declarator
    @@ -5163,7 +5169,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

               struct-or-union-specifier:
    -                  struct-or-union identifieropt { struct-declaration-list }
    +                  struct-or-union identifieropt { struct-declaration-list }
                       struct-or-union identifier
               struct-or-union:
                       struct
    @@ -5174,14 +5180,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
               struct-declaration:
                       specifier-qualifier-list struct-declarator-list ;
               specifier-qualifier-list:
    -                 type-specifier specifier-qualifier-listopt
    -                 type-qualifier specifier-qualifier-listopt
    +                 type-specifier specifier-qualifier-listopt
    +                 type-qualifier specifier-qualifier-listopt
               struct-declarator-list:
                       struct-declarator
                       struct-declarator-list , struct-declarator
               struct-declarator:
                       declarator
    -                  declaratoropt : constant-expression
    + declaratoropt : constant-expression
    Constraints

    A structure or union shall not contain a member with incomplete or function type (hence, @@ -5360,8 +5366,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               enum-specifier:
    -                enum identifieropt { enumerator-list }
    -                enum identifieropt { enumerator-list , }
    +                enum identifieropt { enumerator-list }
    +                enum identifieropt { enumerator-list , }
                     enum identifier
               enumerator-list:
                     enumerator
    @@ -5440,7 +5446,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    A type specifier of the form

    -         struct-or-union identifieropt { struct-declaration-list }
    + struct-or-union identifieropt { struct-declaration-list }
    or
              enum identifier { enumerator-list }
    @@ -5841,19 +5847,19 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               declarator:
    -                 pointeropt direct-declarator
    +                 pointeropt direct-declarator
               direct-declarator:
                       identifier
                       ( declarator )
    -                  direct-declarator [ type-qualifier-listopt assignment-expressionopt ]
    -                  direct-declarator [ static type-qualifier-listopt assignment-expression ]
    +                  direct-declarator [ type-qualifier-listopt assignment-expressionopt ]
    +                  direct-declarator [ static type-qualifier-listopt assignment-expression ]
                       direct-declarator [ type-qualifier-list static assignment-expression ]
    -                  direct-declarator [ type-qualifier-listopt * ]
    +                  direct-declarator [ type-qualifier-listopt * ]
                       direct-declarator ( parameter-type-list )
    -                  direct-declarator ( identifier-listopt )
    +                  direct-declarator ( identifier-listopt )
               pointer:
    -                 * type-qualifier-listopt
    -                 * type-qualifier-listopt pointer
    +                 * type-qualifier-listopt
    +                 * type-qualifier-listopt pointer
               type-qualifier-list:
                      type-qualifier
                      type-qualifier-list type-qualifier
    @@ -5865,7 +5871,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                     parameter-list , parameter-declaration
               parameter-declaration:
                     declaration-specifiers declarator
    -                declaration-specifiers abstract-declaratoropt
    +                declaration-specifiers abstract-declaratoropt
               identifier-list:
                       identifier
                       identifier-list , identifier
    @@ -5900,7 +5906,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 then ident has the type specified by the declaration ''T D''. Thus, a declarator in parentheses is identical to the unparenthesized declarator, but the binding of complicated declarators may be altered by parentheses. - Implementation limits +
    Implementation limits

    As discussed in 5.2.4.1, an implementation may limit the number of pointer, array, and function declarators that modify an arithmetic, structure, union, or incomplete type, either @@ -5912,7 +5918,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    If, in the declaration ''T D1'', D1 has the form

    -         * type-qualifier-listopt D
    + * type-qualifier-listopt D
    and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list T '', then the type specified for ident is ''derived-declarator-type-list type-qualifier-list pointer to T ''. For each type qualifier in the list, ident is a so-qualified pointer. @@ -5957,10 +5963,10 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    If, in the declaration ''T D1'', D1 has one of the forms:

    -          D[ type-qualifier-listopt assignment-expressionopt ]
    -          D[ static type-qualifier-listopt assignment-expression ]
    +          D[ type-qualifier-listopt assignment-expressionopt ]
    +          D[ static type-qualifier-listopt assignment-expression ]
               D[ type-qualifier-list static assignment-expression ]
    -          D[ type-qualifier-listopt * ]
    + D[ type-qualifier-listopt * ]
    and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list T '', then the type specified for ident is ''derived-declarator-type-list array of T ''.123) (See 6.7.5.3 for the meaning of the optional type qualifiers and the keyword static.) @@ -6078,7 +6084,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 or
    -          D( identifier-listopt )
    + D( identifier-listopt ) and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list T '', then the type specified for ident is ''derived-declarator-type-list function returning T ''. @@ -6224,20 +6230,20 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               type-name:
    -                 specifier-qualifier-list abstract-declaratoropt
    +                 specifier-qualifier-list abstract-declaratoropt
               abstract-declarator:
                      pointer
    -                 pointeropt direct-abstract-declarator
    +                 pointeropt direct-abstract-declarator
               direct-abstract-declarator:
                       ( abstract-declarator )
    -                  direct-abstract-declaratoropt [ type-qualifier-listopt
    -                                 assignment-expressionopt ]
    -                  direct-abstract-declaratoropt [ static type-qualifier-listopt
    +                  direct-abstract-declaratoropt [ type-qualifier-listopt
    +                                 assignment-expressionopt ]
    +                  direct-abstract-declaratoropt [ static type-qualifier-listopt
                                      assignment-expression ]
    -                  direct-abstract-declaratoropt [ type-qualifier-list static
    +                  direct-abstract-declaratoropt [ type-qualifier-list static
                                      assignment-expression ]
    -                  direct-abstract-declaratoropt [ * ]
    -                  direct-abstract-declaratoropt ( parameter-type-listopt )
    + direct-abstract-declaratoropt [ * ] + direct-abstract-declaratoropt ( parameter-type-listopt )
    Semantics

    In several contexts, it is necessary to specify a type. This is accomplished using a type @@ -6379,7 +6385,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 { initializer-list , } initializer-list: designationopt initializer - initializer-list , designationopt initializer + initializer-list , designationopt initializer designation: designator-list = designator-list: @@ -6742,7 +6748,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               compound-statement:
    -                { block-item-listopt }
    +                { block-item-listopt }
               block-item-list:
                       block-item
                       block-item-list block-item
    @@ -6758,7 +6764,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

               expression-statement:
    -                 expressionopt ;
    + expressionopt ;
    Semantics

    The expression in an expression statement is evaluated as a void expression for its side @@ -6869,7 +6875,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 a default label, control jumps to the labeled statement. If no converted case constant expression matches and there is no default label, no part of the switch body is executed. - Implementation limits +

    Implementation limits

    As discussed in 5.2.4.1, the implementation may limit the number of case values in a switch statement. @@ -6908,8 +6914,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 iteration-statement: while ( expression ) statement do statement while ( expression ) ; - for ( expressionopt ; expressionopt ; expressionopt ) statement - for ( declaration expressionopt ; expressionopt ) statement + for ( expressionopt ; expressionopt ; expressionopt ) statement + for ( declaration expressionopt ; expressionopt ) statement

    Constraints

    The controlling expression of an iteration statement shall have scalar type. @@ -6977,7 +6983,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 goto identifier ; continue ; break ; - return expressionopt ; + return expressionopt ;

    Semantics

    A jump statement causes an unconditional jump to another place. @@ -7005,10 +7011,10 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

  • The general initialization code is too large to warrant duplication.
  • The code to determine the next operation is at the head of the loop. (To allow it to be reached by continue statements, for example.) +
       /* ... */
       goto first_time;
       for (;;) {
    -
               // determine next operation
               /* ... */
               if (need to reinitialize) {
    @@ -7020,8 +7026,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                       continue;
               }
               // handle other operations
    -          /* ... */
    - } + /* ... */ + }

    @@ -7051,13 +7057,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 A continue statement causes a jump to the loop-continuation portion of the smallest enclosing iteration statement; that is, to the end of the loop body. More precisely, in each of the statements - while (/* ... */) { do { for (/* ... */) {

    + while (/* ... */) {                  do {                                 for (/* ... */) {
         /* ... */                            /* ... */                            /* ... */
         continue;                            continue;                            continue;
    -    /* ... */                            /* ... */                            /* ... */
    + /* ... */ /* ... */ /* ... */ contin: ; contin: ; contin: ; - } } while (/* ... */); } + } } while (/* ... */); } unless the continue statement shown is in an enclosed iteration statement (in which case it is interpreted within that statement), it is equivalent to goto contin;.138) @@ -7178,7 +7184,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               function-definition:
    -                 declaration-specifiers declarator declaration-listopt compound-statement
    +                 declaration-specifiers declarator declaration-listopt compound-statement
               declaration-list:
                      declaration
                      declaration-list declaration
    @@ -7355,7 +7361,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
               preprocessing-file:
    -                 groupopt
    +                 groupopt
               group:
                        group-part
                        group group-part
    @@ -7365,41 +7371,41 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                      text-line
                      # non-directive
               if-section:
    -                   if-group elif-groupsopt else-groupopt endif-line
    +                   if-group elif-groupsopt else-groupopt endif-line
               if-group:
    -                  # if     constant-expression new-line groupopt
    -                  # ifdef identifier new-line groupopt
    -                  # ifndef identifier new-line groupopt
    +                  # if     constant-expression new-line groupopt
    +                  # ifdef identifier new-line groupopt
    +                  # ifndef identifier new-line groupopt
               elif-groups:
                       elif-group
                       elif-groups elif-group
               elif-group:
    -                  # elif       constant-expression new-line groupopt
    +                  # elif       constant-expression new-line groupopt
               else-group:
    -                  # else       new-line groupopt
    +                  # else       new-line groupopt
               endif-line:
                       # endif      new-line
               control-line:
                      # include pp-tokens new-line
                      # define identifier replacement-list new-line
    -                 # define identifier lparen identifier-listopt )
    +                 # 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
                      # undef   identifier new-line
                      # line    pp-tokens new-line
    -                 # error   pp-tokensopt new-line
    -                 # pragma pp-tokensopt new-line
    +                 # error   pp-tokensopt new-line
    +                 # pragma pp-tokensopt new-line
                      #         new-line
               text-line:
    -                  pp-tokensopt new-line
    +                  pp-tokensopt new-line
               non-directive:
                      pp-tokens new-line
               lparen:
                         a ( character not immediately preceded by white-space
               replacement-list:
    -                 pp-tokensopt
    +                 pp-tokensopt
               pp-tokens:
                      preprocessing-token
                      pp-tokens preprocessing-token
    @@ -7483,8 +7489,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    Preprocessing directives of the forms

    -      # if   constant-expression new-line groupopt
    -      # elif constant-expression new-line groupopt
    + # 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 @@ -7512,8 +7518,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    -    # ifdef identifier new-line groupopt
    -    # ifndef identifier new-line groupopt
    + # 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 #if defined identifier and #if !defined identifier respectively. @@ -7539,8 +7545,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    146) Thus, the constant expression in the following #if directive and if statement is not guaranteed to evaluate to the same value in these two contexts. +

        #if 'z' - 'a' == 25
    -   if ('z' - 'a' == 25)
    +   if ('z' - 'a' == 25)

    147) As indicated by the syntax, a preprocessing token shall not follow a #else or #endif directive @@ -7680,7 +7687,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    A preprocessing directive of the form

    -    # define identifier lparen identifier-listopt ) replacement-list new-line
    +    # 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 parameters, whose use is similar syntactically to a @@ -7989,7 +7996,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    A preprocessing directive of the form

    -    # line digit-sequence "s-char-sequenceopt" new-line
    + # line digit-sequence "s-char-sequenceopt" new-line sets the presumed line number similarly and changes the presumed name of the source file to be the contents of the character string literal.

    @@ -8008,7 +8015,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    A preprocessing directive of the form

    -    # error pp-tokensopt new-line
    + # error pp-tokensopt new-line causes the implementation to produce a diagnostic message that includes the specified sequence of preprocessing tokens. @@ -8017,7 +8024,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    A preprocessing directive of the form

    -    # pragma pp-tokensopt new-line
    + # pragma pp-tokensopt new-line where the preprocessing token STDC does not immediately follow pragma in the directive (prior to any macro replacement)152) causes the implementation to behave in an implementation-defined manner. The behavior might cause translation to fail or cause the @@ -8063,54 +8070,49 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    6.10.8 Predefined macro names

    The following macro names154) shall be defined by the implementation: - __DATE__ The date of translation of the preprocessing translation unit: a character -

    +
    +
    __DATE__
    The date of translation of the preprocessing translation unit: a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10. If the date of translation is not available, an implementation-defined valid date - shall be supplied.
    - __FILE__ The presumed name of the current source file (a character string literal).155) - __LINE__ The presumed line number (within the current source file) of the current -
    -            source line (an integer constant).155)
    - __STDC__ The integer constant 1, intended to indicate a conforming implementation. - __STDC_HOSTED__ The integer constant 1 if the implementation is a hosted -
    -           implementation or the integer constant 0 if it is not.
    - __STDC_MB_MIGHT_NEQ_WC__ The integer constant 1, intended to indicate that, in -
    +            shall be supplied.
    +
    __FILE__
    The presumed name of the current source file (a character string literal).155) +
    __LINE__
    The presumed line number (within the current source file) of the current + source line (an integer constant).155) +
    __STDC__
    The integer constant 1, intended to indicate a conforming implementation. +
    __STDC_HOSTED__
    The integer constant 1 if the implementation is a hosted + implementation or the integer constant 0 if it is not. +
    __STDC_MB_MIGHT_NEQ_WC__
    The integer constant 1, intended to indicate that, in the encoding for wchar_t, a member of the basic character set need not have a code value equal to its value when used as the lone character in an - integer character constant.
    - __STDC_VERSION__ The integer constant 199901L.156) - __TIME__ The time of translation of the preprocessing translation unit: a character -
    +           integer character constant.
    +
    __STDC_VERSION__
    The integer constant 199901L.156) +
    __TIME__
    The time of translation of the preprocessing translation unit: a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function. If the time of translation is not available, an - implementation-defined valid time shall be supplied.
    - + implementation-defined valid time shall be supplied. +

    The following macro names are conditionally defined by the implementation: - __STDC_IEC_559__ The integer constant 1, intended to indicate conformance to the -

    -           specifications in annex F (IEC 60559 floating-point arithmetic).
    - __STDC_IEC_559_COMPLEX__ The integer constant 1, intended to indicate -
    +
    +
    __STDC_IEC_559__
    The integer constant 1, intended to indicate conformance to the + specifications in annex F (IEC 60559 floating-point arithmetic). +
    __STDC_IEC_559_COMPLEX__
    The integer constant 1, intended to indicate adherence to the specifications in informative annex G (IEC 60559 - compatible complex arithmetic).
    - __STDC_ISO_10646__ An integer constant of the form yyyymmL (for example, -

    -

    +           compatible complex arithmetic).
    +
    __STDC_ISO_10646__
    An integer constant of the form yyyymmL (for example, 199712L). If this symbol is defined, then every character in the Unicode required set, when stored in an object of type wchar_t, has the same value as the short identifier of that character. The Unicode required set consists of all the characters that are defined by ISO/IEC 10646, along with all amendments and technical corrigenda, as of the specified year and - month.
    + month. + +

    The values of the predefined macros (except for __FILE__ and __LINE__) remain constant throughout the translation unit.

    @@ -12307,7 +12309,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 static type t; then the expression &(t.member-designator) evaluates to an address constant. (If the specified member is a bit-field, the behavior is undefined.) - Recommended practice +

    Recommended practice

    The types used for size_t and ptrdiff_t should not have an integer conversion rank greater than that of signed long int unless the implementation supports objects @@ -12974,7 +12976,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 existing file and that will automatically be removed when it is closed or at program termination. If the program terminates abnormally, whether an open temporary file is removed is implementation-defined. The file is opened for update with "wb+" mode. - Recommended practice +

    Recommended practice

    It should be possible to open at least TMP_MAX temporary files during the lifetime of the program (this limit may be shared with tmpnam) and there should be no limit on the @@ -13508,7 +13510,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded to a hexadecimal floating number with the given precision. - Recommended practice +

    Recommended practice

    For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers @@ -14867,7 +14869,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of nptr is stored in the object pointed to by endptr, provided that endptr is not a null pointer. - Recommended practice +

    Recommended practice

    If the subject sequence has the hexadecimal form, FLT_RADIX is not a power of 2, and the result is not exactly representable, the result should be one of the two numbers in the @@ -16970,7 +16972,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded to a hexadecimal floating number with the given precision. - Recommended practice +

    Recommended practice

    For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers @@ -17846,7 +17848,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of nptr is stored in the object pointed to by endptr, provided that endptr is not a null pointer. - Recommended practice +

    Recommended practice

    If the subject sequence has the hexadecimal form, FLT_RADIX is not a power of 2, and the result is not exactly representable, the result should be one of the two numbers in the @@ -20808,7 +20810,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

                                         (informative)
    -                             Implementation limits
    +
    Implementation limits
    The contents of the header <limits.h> are given below, in alphabetical order. The minimum magnitudes shown shall be replaced by implementation-defined magnitudes with the same sign. The values shall all be constant expressions suitable for use in #if @@ -20919,7 +20921,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Any non-IEC 60559 extended format used for the long double type shall have more precision than IEC 60559 double and at least the range of IEC 60559 double.308) - Recommended practice +
    Recommended practice

    The long double type should match an IEC 60559 extended format. @@ -21074,7 +21076,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 A contracted expression treats infinities, NaNs, signed zeros, subnormals, and the rounding directions in a manner consistent with the basic arithmetic operations covered by IEC 60559. - Recommended practice +

    Recommended practice

    A contracted expression should raise floating-point exceptions in a manner generally consistent with the basic arithmetic operations. A contracted expression should deliver @@ -21113,7 +21115,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

  • The rounding precision mode (if supported) is set so that results are not shortened.
  • Trapping or stopping (if supported) is disabled on all floating-point exceptions. - Recommended practice +
    Recommended practice

    The implementation should produce a diagnostic message for each translation-time @@ -21458,7 +21460,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 For families of functions, the specifications apply to all of the functions even though only the principal function is shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument and the result, the result has the same sign as the argument. - Recommended practice +

    Recommended practice

    If a function with one or more NaN arguments returns a NaN result, the result should be the same as one of the NaN arguments (after possible type conversion), except perhaps -- 2.20.1