From: nsz Date: Fri, 22 Jul 2011 13:48:35 +0000 (+0200) Subject: move on new line X-Git-Url: http://nsz.repo.hu/git/?p=c-standard;a=commitdiff_plain;h=23a67101d272654dc45920a5ef98dc72a7512b12 move on new line --- diff --git a/ann2html.sh b/ann2html.sh index 8999198..d5f9042 100755 --- a/ann2html.sh +++ b/ann2html.sh @@ -133,7 +133,7 @@ seencontents && !seenfore && /^[^@]/ { /^@end pre/ { if (!pre) next - pre = pre "\n" + pre = pre "\n\n" if (nn) note[nn] = note[nn] "\n" pre else diff --git a/n1548.html b/n1548.html index e21d333..8854018 100644 --- a/n1548.html +++ b/n1548.html @@ -995,7 +995,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. char a; int b:5, c:11, :0, d:8; struct { int ee:8; } e; - } + } + contains four separate memory locations: The member a, and bit-fields d and e.ee are each separate memory locations, and can be modified concurrently without interfering with each other. The bit-fields b and c together constitute the fourth memory location. The bit-fields b and c cannot be concurrently @@ -1164,7 +1165,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. /* ... */ fesetround(FE_UPWARD); /* ... */ - #endif + #endif +

4) This implies that a conforming implementation reserves no identifiers other than those explicitly @@ -1280,7 +1282,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE An implementation shall issue a diagnostic for the translation unit:

           char i;
-          int i;
+ int i; + because in those cases where wording in this International Standard describes the behavior for a construct as being both a constraint error and resulting in undefined behavior, the constraint error shall be diagnosed. @@ -1327,11 +1330,13 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. prototype for this function. It shall be defined with a return type of int and with no parameters:
-         int main(void) { /* ... */ }
+ int main(void) { /* ... */ } + or with two parameters (referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared):
-         int main(int argc, char *argv[]) { /* ... */ }
+ int main(int argc, char *argv[]) { /* ... */ } + or equivalent;10) or in some other implementation-defined manner.

If they are declared, the parameters to the main function shall obey the following @@ -1458,7 +1463,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

           char c1, c2;
           /* ... */
-          c1 = c1 + c2;
+ c1 = c1 + c2; + the ''integer promotions'' require that the abstract machine promote the value of each variable to int size and then add the two ints and truncate the sum. Provided the addition of two chars can be done without overflow, or with overflow wrapping silently to produce the correct result, the actual execution need only @@ -1470,7 +1476,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. float f1, f2; double d; /* ... */ - f1 = f2 * d; + f1 = f2 * d; + the multiplication may be executed using single-precision arithmetic if the implementation can ascertain that the result would be the same as if it were executed using double-precision arithmetic (for example, if d were replaced by the constant 2.0, which has type double). @@ -1485,7 +1492,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. double d1, d2; float f; d1 = f = expression; - d2 = (float) expression; + d2 = (float) expression; + the values assigned to d1 and d2 are required to have been converted to float.

@@ -1501,31 +1509,37 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. x = (x * y) * z; // not equivalent to x *= y * z; z = (x - y) + y ; // not equivalent to z = x; z = x + x * y; // not equivalent to z = x * (1.0 + y); - y = x / 5.0; // not equivalent to y = x * 0.2; + y = x / 5.0; // not equivalent to y = x * 0.2; +

EXAMPLE 6 To illustrate the grouping behavior of expressions, in the following fragment

           int a, b;
           /* ... */
-          a = a + 32760 + b + 5;
+ a = a + 32760 + b + 5; + the expression statement behaves exactly the same as
-          a = (((a + 32760) + b) + 5);
+ a = (((a + 32760) + b) + 5); + due to the associativity and precedence of these operators. Thus, the result of the sum (a + 32760) is next added to b, and that result is then added to 5 which results in the value assigned to a. On a machine in which overflows produce an explicit trap and in which the range of values representable by an int is [-32768, +32767], the implementation cannot rewrite this expression as
-          a = ((a + b) + 32765);
+ a = ((a + b) + 32765); + since if the values for a and b were, respectively, -32754 and -15, the sum a + b would produce a trap while the original expression would not; nor can the expression be rewritten either as
-          a = ((a + 32765) + b);
+ a = ((a + 32765) + b); + or
-          a = (a + (b + 32765));
+ a = (a + (b + 32765)); + since the values for a and b might have been, respectively, 4 and -8 or -17 and 12. However, on a machine in which overflow silently generates some value and where positive and negative overflows cancel, the above expression statement can be rewritten by the implementation in any of the above ways because the @@ -1539,10 +1553,12 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. int sum; char *p; /* ... */ - sum = sum * 10 - '0' + (*p++ = getchar()); + sum = sum * 10 - '0' + (*p++ = getchar()); + the expression statement is grouped as if it were written as
-          sum = (((sum * 10) - '0') + ((*(p++)) = (getchar())));
+ sum = (((sum * 10) - '0') + ((*(p++)) = (getchar()))); + but the actual increment of p can occur at any time between the previous sequence point and the next sequence point (the ;), and the call to getchar can occur at any point prior to the need of its returned value. @@ -1802,18 +1818,22 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. members: the 26 uppercase letters of the Latin alphabet
          A    B   C      D   E   F    G    H    I    J    K    L   M
-         N    O   P      Q   R   S    T    U    V    W    X    Y   Z
+ N O P Q R S T U V W X Y Z + the 26 lowercase letters of the Latin alphabet
          a    b   c      d   e   f    g    h    i    j    k    l   m
-         n    o   p      q   r   s    t    u    v    w    x    y   z
+ n o p q r s t u v w x y z + the 10 decimal digits
-         0    1   2      3   4   5    6    7    8    9
+ 0 1 2 3 4 5 6 7 8 9 + the following 29 graphic characters
          !    "   #      %   &   '    (    )    *    +    ,    -   .    /    :
-         ;    <   =      >   ?   [    \    ]    ^    _    {    |   }    ~
+ ; < = > ? [ \ ] ^ _ { | } ~ + the space character, and control characters representing horizontal tab, vertical tab, and form feed. The representation of each member of the source and execution basic character sets shall fit in a byte. In both the source and execution basic character sets, the @@ -1842,24 +1862,29 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
         ??=      #                       ??)      ]                       ??!     |
         ??(      [                       ??'      ^                       ??>     }
-        ??/      \                       ??<      {                       ??-     ~
+ ??/ \ ??< { ??- ~ + No other trigraph sequences exist. Each ? that does not begin one of the trigraphs listed above is not changed.

EXAMPLE 1

-           ??=define arraycheck(a, b) a??(b??) ??!??! b??(a??)
+ ??=define arraycheck(a, b) a??(b??) ??!??! b??(a??) + becomes
-           #define arraycheck(a, b) a[b] || b[a]
+ #define arraycheck(a, b) a[b] || b[a] +

EXAMPLE 2 The following source line

-           printf("Eh???/n");
+ printf("Eh???/n"); + becomes (after replacement of the trigraph sequence ??/)
-           printf("Eh?\n");
+ printf("Eh?\n"); +
footnotes
@@ -1914,21 +1939,25 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. \b (backspace) Moves the active position to the previous position on the current line. If
     the active position is at the initial position of a line, the behavior of the display
-    device is unspecified.
+ device is unspecified. + \f ( form feed) Moves the active position to the initial position at the start of the next
-    logical page.
+ logical page. + \n (new line) Moves the active position to the initial position of the next line. \r (carriage return) Moves the active position to the initial position of the current line. \t (horizontal tab) Moves the active position to the next horizontal tabulation position
     on the current line. If the active position is at or past the last defined horizontal
-    tabulation position, the behavior of the display device is unspecified.
+ tabulation position, the behavior of the display device is unspecified. + \v (vertical tab) Moves the active position to the initial position of the next vertical
     tabulation position. If the active position is at or past the last defined vertical
-      tabulation position, the behavior of the display device is unspecified.
+ tabulation position, the behavior of the display device is unspecified. +

Each of these escape sequences shall produce a unique implementation-defined value which can be stored in a single char object. The external representations in a text file @@ -1974,7 +2003,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

     universal character name specifying a short identifier of 00010000 or more is
     considered 10 characters, and each extended source character is considered the same
-    number of characters as the corresponding universal character name, if any)19)
+ number of characters as the corresponding universal character name, if any)19) +
  • 4095 external identifiers in one translation unit
  • 511 identifiers with block scope declared in one block
  • 4095 macro identifiers simultaneously defined in one preprocessing translation unit @@ -2081,14 +2111,16 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. b base or radix of exponent representation (an integer > 1) e exponent (an integer between a minimum emin and a maximum emax ) p precision (the number of base-b digits in the significand) - fk nonnegative integers less than b (the significand digits) + fk nonnegative integers less than b (the significand digits) +

    A floating-point number (x) is defined by the following model:

                         p
             x = sb e   (Sum) f k b-k ,
                        k=1
    -                                 emin <= e <= emax
    + emin <= e <= emax +

    In addition to normalized floating-point numbers ( f 1 > 0 if x != 0), floating types may be @@ -2136,7 +2168,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 0 toward zero 1 to nearest 2 toward positive infinity - 3 toward negative infinity + 3 toward negative infinity + All other values for FLT_ROUNDS characterize implementation-defined rounding behavior. @@ -2157,7 +2190,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. operations and constants to the range and precision of the long double type; 2 evaluate all operations and constants to the range and precision of the - long double type. + long double type. + All other negative values for FLT_EVAL_METHOD characterize implementation-defined behavior.

    @@ -2167,7 +2201,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

             -1       indeterminable25)
              0       absent26) (type does not support subnormal numbers)
    -         1       present (type does support subnormal numbers)
    + 1 present (type does support subnormal numbers) +

    The values given in the following list shall be replaced by constant expressions with implementation-defined values that are greater or equal in magnitude (absolute value) to @@ -2190,7 +2225,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

           { p log10 b        if b is a power of 10
           {
    -      { [^1 + p log10 b^] otherwise
    + { [^1 + p log10 b^] otherwise + FLT_DECIMAL_DIG 6 DBL_DECIMAL_DIG 10 LDBL_DECIMAL_DIG 10 @@ -2200,7 +2236,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
           { pmax log10 b       if b is a power of 10
           {
    -      { [^1 + pmax log10 b^] otherwise
    + { [^1 + pmax log10 b^] otherwise + DECIMAL_DIG 10
  • number of decimal digits, q, such that any floating-point number with q decimal digits can be rounded into a floating-point number with p radix b digits and back again @@ -2208,7 +2245,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
           { p log10 b          if b is a power of 10
           {
    -      { [_( p - 1) log10 b_] otherwise
    + { [_( p - 1) log10 b_] otherwise + FLT_DIG 6 DBL_DIG 10 LDBL_DIG 10 @@ -2221,7 +2259,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
  • minimum negative integer such that 10 raised to that power is in the range of normalized floating-point numbers, [^log10 b emin -1 ^]
    -                                   [                  ]
    + [ ] + FLT_MIN_10_EXP -37 DBL_MIN_10_EXP -37 LDBL_MIN_10_EXP -37 @@ -2230,13 +2269,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
         FLT_MAX_EXP
         DBL_MAX_EXP
    -    LDBL_MAX_EXP
    + LDBL_MAX_EXP +
  • maximum integer such that 10 raised to that power is in the range of representable finite floating-point numbers, [_log10 ((1 - b- p )b emax )_]
         FLT_MAX_10_EXP                               +37
         DBL_MAX_10_EXP                               +37
    -    LDBL_MAX_10_EXP                              +37
    + LDBL_MAX_10_EXP +37 +

    The values given in the following list shall be replaced by constant expressions with @@ -2246,7 +2287,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

         FLT_MAX                                   1E+37
         DBL_MAX                                   1E+37
    -    LDBL_MAX                                  1E+37
    + LDBL_MAX 1E+37 +

    The values given in the following list shall be replaced by constant expressions with @@ -2257,13 +2299,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

         FLT_EPSILON                                1E-5
         DBL_EPSILON                                1E-9
    -    LDBL_EPSILON                               1E-9
    + LDBL_EPSILON 1E-9 +
  • minimum normalized positive floating-point number, b emin -1
         FLT_MIN                                   1E-37
         DBL_MIN                                   1E-37
    -    LDBL_MIN                                  1E-37
    + LDBL_MIN 1E-37 +
  • minimum positive floating-point number27) FLT_TRUE_MIN 1E-37 DBL_TRUE_MIN 1E-37 @@ -2281,7 +2325,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 6 x = s16e (Sum) f k 16-k , k=1 - -31 <= e <= +32 + -31 <= e <= +32 +
              FLT_RADIX                                    16
    @@ -2294,7 +2339,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
              FLT_MIN_10_EXP                              -38
              FLT_MAX_EXP                                 +32
              FLT_MAX                         3.40282347E+38F
    -         FLT_MAX_10_EXP                              +38
    + FLT_MAX_10_EXP +38 +

    EXAMPLE 2 The following describes floating-point representations that also meet the requirements for @@ -2304,13 +2350,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 24 x f = s2e (Sum) f k 2-k , k=1 - -125 <= e <= +128 + -125 <= e <= +128 +

                        53
            x d = s2e   (Sum) f k 2-k ,
                        k=1
    -                                  -1021 <= e <= +1024
    + -1021 <= e <= +1024 +
              FLT_RADIX                                     2
    @@ -2318,7 +2366,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
              FLT_MANT_DIG                                 24
              FLT_EPSILON                     1.19209290E-07F // decimal constant
              FLT_EPSILON                            0X1P-23F // hex constant
    -         FLT_DECIMAL_DIG                               9
    + FLT_DECIMAL_DIG 9 + @@ -2350,7 +2399,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. DBL_MAX_EXP +1024 DBL_MAX 1.7976931348623157E+308 // decimal constant DBL_MAX 0X1.fffffffffffffP1023 // hex constant - DBL_MAX_10_EXP +308 + DBL_MAX_10_EXP +308 + If a type wider than double were supported, then DECIMAL_DIG would be greater than 17. For example, if the widest type were to use the minimal-width IEC 60559 double-extended format (64 bits of precision), then DECIMAL_DIG would be 21. @@ -2400,7 +2450,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 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 @@ -2908,7 +2959,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

                                                CHAR_BIT
    -                                                     - 1.
    + - 1. +

    50) 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. @@ -3053,10 +3105,12 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE Given the following two file scope declarations:

               int f(int (*)(), double (*)[3]);
    -          int f(int (*)(char *), double (*)[]);
    + int f(int (*)(char *), double (*)[]); + The resulting composite type for the function is:
    -          int f(int (*)(char *), double (*)[3]);
    + int f(int (*)(char *), double (*)[3]); +
    footnotes
    @@ -3287,7 +3341,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 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. + 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 @@ -3448,7 +3503,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. character-constant string-literal punctuator - each non-white-space character that cannot be one of the above + each non-white-space character that cannot be one of the above +

    Constraints

    Each preprocessing token that is converted to a token shall have the lexical form of a @@ -3522,7 +3578,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. enum static _Noreturn extern struct _Static_assert float switch _Thread_local - for typedef + for typedef +

    Semantics

    The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as @@ -3554,7 +3611,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z digit: one of - 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 +

    Semantics

    An identifier is a sequence of nondigit characters (including the underscore _, the @@ -3601,7 +3659,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. The identifier __func__ shall be implicitly declared by the translator as if, immediately following the opening brace of each function definition, the declaration

    -          static const char __func__[] = "function-name";
    + static const char __func__[] = "function-name"; + appeared, where function-name is the name of the lexically-enclosing function.72)

    This name is encoded as if the implicit declaration had been written in the source @@ -3615,10 +3674,12 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. { printf("%s\n", __func__); /* ... */ - } + } + Each time the function is called, it will print to the standard output stream:

    -          myfunc
    + myfunc +

    Forward references: function definitions (6.9.1). @@ -3641,7 +3702,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. \U hex-quad hex-quad hex-quad: hexadecimal-digit hexadecimal-digit - hexadecimal-digit hexadecimal-digit + hexadecimal-digit hexadecimal-digit +

    Constraints

    A universal character name shall not specify a character whose short identifier is less than @@ -3680,7 +3742,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. integer-constant floating-constant enumeration-constant - character-constant + character-constant +

    Constraints

    Each constant shall have a type and the value of a constant shall be in the range of @@ -3727,7 +3790,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. long-suffix: one of l L long-long-suffix: one of - ll LL + ll LL +

    Description

    An integer constant begins with a digit, but has no period or exponent part. It may have a @@ -3747,7 +3811,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. be represented.

    -                                                                  Octal or Hexadecimal
    + Octal or Hexadecimal + Suffix Decimal Constant Constant none int int @@ -3756,25 +3821,29 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. long long int long int unsigned long int long long int - unsigned 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
    + 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
    + 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
    + unsigned long long int + Both u or U unsigned long long int unsigned long long int and ll or LL @@ -3826,7 +3895,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. hexadecimal-digit hexadecimal-digit-sequence hexadecimal-digit floating-suffix: one of - f l F L + f l F L +
    Description

    A floating constant has a significand part that may be followed by an exponent part and a @@ -3882,7 +3952,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               enumeration-constant:
    -                identifier
    + identifier +
    Semantics

    An identifier declared as an enumeration constant has type int. @@ -3919,7 +3990,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. \ octal-digit octal-digit octal-digit hexadecimal-escape-sequence: \x hexadecimal-digit - hexadecimal-escape-sequence hexadecimal-digit + hexadecimal-escape-sequence hexadecimal-digit +

    Description

    An integer character constant is a sequence of one or more multibyte characters enclosed @@ -3937,7 +4009,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. question mark ? \? backslash \ \\ octal character \octal digits - hexadecimal character \x hexadecimal digits + hexadecimal character \x hexadecimal digits +

    The double-quote " and question-mark ? are representable either by themselves or by the escape sequences \" and \?, respectively, but the single-quote ' and the backslash \ @@ -3971,7 +4044,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. none unsigned char L the unsigned type corresponding to wchar_t u char16_t - U char32_t + U char32_t +

    Semantics

    An integer character constant has type int. The value of an integer character constant @@ -4047,7 +4121,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. s-char: any member of the source character set except the double-quote ", backslash \, or new-line character - escape-sequence + escape-sequence +

    Constraints

    A sequence of adjacent string literal tokens shall not include both a wide string literal and @@ -4098,7 +4173,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 1 This pair of adjacent character string literals

    -          "\x12" "3"
    + "\x12" "3" + produces a single character string literal containing the two characters whose values are '\x12' and '3', because escape sequences are converted into single members of the execution character set just prior to adjacent string literal concatenation. @@ -4113,19 +4189,23 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. "a" "b" L"c" "a" L"b" "c" L"a" "b" L"c" - L"a" L"b" L"c" + L"a" L"b" L"c" + is equivalent to the string literal
    -          L"abc"
    + L"abc" + Likewise, each of the sequences
               "a" "b" u"c"
               "a" u"b" "c"
               u"a" "b" u"c"
    -          u"a" u"b" u"c"
    + u"a" u"b" u"c" + is equivalent to
    -          u"abc"
    + u"abc" +

    Forward references: common definitions <stddef.h> (7.19), the mbstowcs function (7.22.8.1), Unicode utilities <uchar.h> (7.27). @@ -4146,7 +4226,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. ? : ; ... = *= /= %= += -= <<= >>= &= ^= |= , # ## - <: :> <% %> %: %:%: + <: :> <% %> %: %:%: +

    Semantics

    A punctuator is a symbol that has independent syntactic and semantic significance. @@ -4158,10 +4239,12 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    In all aspects of the language, the six tokens79)

    -          <:    :>      <%    %>     %:     %:%:
    + <: :> <% %> %: %:%: + behave, respectively, the same as the six tokens
    -          [     ]       {     }      #      ##
    + [ ] { } # ## + except for their spelling.80)

    Forward references: expressions (6.5), declarations (6.7), preprocessing directives (6.10), statements (6.8). @@ -4191,7 +4274,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. q-char-sequence q-char q-char: any member of the source character set except - the new-line character and " + the new-line character and " +

    Semantics

    The sequences in both forms of header names are mapped in an implementation-defined @@ -4212,13 +4296,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               0x3<1/a.h>1e2
               #include <1/a.h>
    -          #define const.member@$
    + #define const.member@$ + forms the following sequence of preprocessing tokens (with each individual preprocessing token delimited by a { on the left and a } on the right).
               {0x3}{<}{1}{/}{a}{.}{h}{>}{1e2}
               {#}{include} {<1/a.h>}
    -          {#}{define} {const}{.}{member}{@}{$}
    + {#}{define} {const}{.}{member}{@}{$} +

    Forward references: source file inclusion (6.10.2). @@ -4241,7 +4327,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. pp-number E sign pp-number p sign pp-number P sign - pp-number . + pp-number . +

    Description

    A preprocessing number begins with a digit optionally preceded by a period (.) and may @@ -4283,7 +4370,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. glue(/,/) k(); // syntax error, not comment /*//*/ l(); // equivalent to l(); m = n//**/o - + p; // equivalent to m = n + p; + + p; // equivalent to m = n + p; + @@ -4363,12 +4451,14 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

                i = ++i + 1;
    -           a[i++] = i;
    + a[i++] = i; + while allowing
                i = i + 1;
    -           a[i] = i;
    + a[i] = i; +

    85) The syntax specifies the precedence of operators in the evaluation of an expression, which is the same @@ -4408,7 +4498,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. constant string-literal ( expression ) - generic-selection + generic-selection +

    Semantics

    An identifier is a primary expression, provided it has been declared as designating an @@ -4441,7 +4532,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. generic-assoc-list , generic-association generic-association: type-name : assignment-expression - default : assignment-expression + default : assignment-expression +

    Constraints

    A generic selection shall have no more than one default generic association. The type @@ -4472,7 +4564,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. long double: cbrtl, \ default: cbrt, \ float: cbrtf \ - )(X) + )(X) +

    6.5.2 Postfix operators

    @@ -4492,7 +4585,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. ( type-name ) { initializer-list , } argument-expression-list: assignment-expression - argument-expression-list , assignment-expression + argument-expression-list , assignment-expression +
    6.5.2.1 Array subscripting
    Constraints
    @@ -4518,7 +4612,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE Consider the array object defined by the declaration

    -          int x[3][5];
    + int x[3][5]; + Here x is a 3 x 5 array of ints; more precisely, x is an array of three element objects, each of which is an array of five ints. In the expression x[i], which is equivalent to (*((x)+(i))), x is first converted to a pointer to the initial array of five ints. Then i is adjusted according to the type of x, which conceptually @@ -4604,7 +4699,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE In the function call

    -          (*pf[f1()]) (f2(), f3() + f4())
    + (*pf[f1()]) (f2(), f3() + f4()) + the functions f1, f2, f3, and f4 may be called in any order. All side effects have to be completed before the function pointed to by pf[f1()] is called. @@ -4666,7 +4762,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. struct s { int i; const int ci; }; struct s s; const struct s cs; - volatile struct s vs; + volatile struct s vs; + the various members have the types:
               s.i          int
    @@ -4674,7 +4771,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
               cs.i         const int
               cs.ci        const int
               vs.i         volatile int
    -          vs.ci        volatile const int
    + vs.ci volatile const int + @@ -4701,7 +4799,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. /* ... */ if (u.n.alltypes == 1) if (sin(u.nf.doublenode) == 0.0) - /* ... */ + /* ... */ + The following is not a valid fragment (because the union type is not visible within function f):
               struct t1 { int m; };
    @@ -4720,7 +4819,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                     } u;
                     /* ... */
                     return f(&u.s1, &u.s2);
    -          }
    + } +

    Forward references: address and indirection operators (6.5.3.2), structure and union specifiers (6.7.2.1). @@ -4771,7 +4871,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. T result = E; do { tmp = result + 1; - } while (!atomic_compare_exchange_strong(&E, &result, tmp)); + } while (!atomic_compare_exchange_strong(&E, &result, tmp)); + with result being the result of the operation. @@ -4809,7 +4910,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 1 The file scope definition

    -          int *p = (int []){2, 4};
    + int *p = (int []){2, 4}; + initializes p to point to the first element of an array of two ints, the first having the value two and the second, four. The expressions in this compound literal are required to be constant. The unnamed object has static storage duration. @@ -4823,7 +4925,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. /*...*/ p = (int [2]){*p}; /*...*/ - } + } + p is assigned the address of the first element of an array of two ints, the first having the value previously pointed to by p and the second, zero. The expressions in this compound literal need not be constant. The unnamed object has automatic storage duration. @@ -4833,7 +4936,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. created using compound literals can be passed to functions without depending on member order:
               drawline((struct point){.x=1, .y=1},
    -                (struct point){.x=3, .y=4});
    + (struct point){.x=3, .y=4}); + Or, if drawline instead expected pointers to struct point: @@ -4841,19 +4945,22 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
               drawline(&(struct point){.x=1, .y=1},
    -                &(struct point){.x=3, .y=4});
    + &(struct point){.x=3, .y=4}); +

    EXAMPLE 4 A read-only compound literal can be specified through constructions like:

    -          (const float []){1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6}
    + (const float []){1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6} +

    EXAMPLE 5 The following three expressions have different meanings:

               "/tmp/fileXXXXXX"
               (char []){"/tmp/fileXXXXXX"}
    -          (const char []){"/tmp/fileXXXXXX"}
    + (const char []){"/tmp/fileXXXXXX"} + The first always has static storage duration and has type array of char, but need not be modifiable; the last two have automatic storage duration when they occur within the body of a function, and the first of these two is modifiable. @@ -4862,7 +4969,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE 6 Like string literals, const-qualified compound literals can be placed into read-only memory and can even be shared. For example,
    -          (const char []){"abc"} == "abc"
    + (const char []){"abc"} == "abc" + might yield 1 if the literals' storage is shared.

    @@ -4872,7 +4980,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               struct int_list { int car; struct int_list *cdr; };
               struct int_list endless_zeros = {0, &endless_zeros};
    -          eval(endless_zeros);
    + eval(endless_zeros); +

    EXAMPLE 8 Each compound literal creates only a single object in a given scope: @@ -4886,7 +4995,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. q = p, p = &((struct s){ j++ }); if (j < 2) goto again; return p == q && q->i == 1; - } + } + The function f() always returns the value 1.

    Note that if an iteration statement were used instead of an explicit goto and a labeled statement, the @@ -4919,7 +5029,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. sizeof ( type-name ) alignof ( type-name ) unary-operator: one of - & * + - ~ ! + & * + - ~ ! +

    6.5.3.1 Prefix increment and decrement operators
    Constraints
    @@ -5035,20 +5146,23 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. allocate and return a pointer to void. For example:
              extern void *alloc(size_t);
    -         double *dp = alloc(sizeof *dp);
    + double *dp = alloc(sizeof *dp); + The implementation of the alloc function should ensure that its return value is aligned suitably for conversion to a pointer to double.

    EXAMPLE 2 Another use of the sizeof operator is to compute the number of elements in an array:

    -         sizeof array / sizeof array[0]
    + sizeof array / sizeof array[0] +

    EXAMPLE 3 In this example, the size of a variable length array is computed and returned from a function:

    -         #include <stddef.h>
    + #include <stddef.h> + @@ -5064,7 +5178,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. size_t size; size = fsize3(10); // fsize3 returns 13 return 0; - } + } +

    Forward references: common definitions <stddef.h> (7.19), declarations (6.7), structure and union specifiers (6.7.2.1), type names (6.7.7), array declarators (6.7.6.2). @@ -5080,7 +5195,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               cast-expression:
                      unary-expression
    -                 ( type-name ) cast-expression
    + ( type-name ) cast-expression +
    Constraints

    Unless the type name specifies a void type, the type name shall specify atomic, qualified, @@ -5119,7 +5235,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. cast-expression multiplicative-expression * cast-expression multiplicative-expression / cast-expression - multiplicative-expression % cast-expression + multiplicative-expression % cast-expression +

    Constraints

    Each of the operands shall have arithmetic type. The operands of the % operator shall @@ -5150,7 +5267,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. additive-expression: multiplicative-expression additive-expression + multiplicative-expression - additive-expression - multiplicative-expression + additive-expression - multiplicative-expression +

    Constraints

    For addition, either both operands shall have arithmetic type, or one operand shall be a @@ -5225,7 +5343,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. p += 1; // p == &a[1] (*p)[2] = 99; // a[1][2] == 99 n = p - a; // n == 1 - } + } +

    If array a in the above example were declared to be an array of known constant size, and pointer p were declared to be a pointer to an array of the same known constant size (pointing to a), the results would be @@ -5252,7 +5371,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. shift-expression: additive-expression shift-expression << additive-expression - shift-expression >> additive-expression + shift-expression >> additive-expression +

    Constraints

    Each of the operands shall have integer type. @@ -5284,7 +5404,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. relational-expression < shift-expression relational-expression > shift-expression relational-expression <= shift-expression - relational-expression >= shift-expression + relational-expression >= shift-expression +

    Constraints

    One of the following shall hold: @@ -5331,7 +5452,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. equality-expression: relational-expression equality-expression == relational-expression - equality-expression != relational-expression + equality-expression != relational-expression +

    Constraints

    One of the following shall hold: @@ -5391,7 +5513,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               AND-expression:
                     equality-expression
    -                AND-expression & equality-expression
    + AND-expression & equality-expression +
    Constraints

    Each of the operands shall have integer type. @@ -5414,7 +5537,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               exclusive-OR-expression:
                       AND-expression
    -                  exclusive-OR-expression ^ AND-expression
    + exclusive-OR-expression ^ AND-expression +
    Constraints

    Each of the operands shall have integer type. @@ -5432,7 +5556,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               inclusive-OR-expression:
                       exclusive-OR-expression
    -                  inclusive-OR-expression | exclusive-OR-expression
    + inclusive-OR-expression | exclusive-OR-expression +
    Constraints

    Each of the operands shall have integer type. @@ -5451,7 +5576,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               logical-AND-expression:
                       inclusive-OR-expression
    -                  logical-AND-expression && inclusive-OR-expression
    + logical-AND-expression && inclusive-OR-expression +
    Constraints

    Each of the operands shall have scalar type. @@ -5471,7 +5597,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               logical-OR-expression:
                       logical-AND-expression
    -                  logical-OR-expression || logical-AND-expression
    + logical-OR-expression || logical-AND-expression +
    Constraints

    Each of the operands shall have scalar type. @@ -5492,7 +5619,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               conditional-expression:
                      logical-OR-expression
    -                 logical-OR-expression ? expression : conditional-expression
    + logical-OR-expression ? expression : conditional-expression +
    Constraints

    The first operand shall have scalar type. @@ -5542,7 +5670,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. const int *c_ip; volatile int *v_ip; int *ip; - const char *c_cp; + const char *c_cp; + the third column in the following table is the common type that is the result of a conditional expression in which the first two columns are the second and third operands (in either order):

    @@ -5551,7 +5680,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                c_ip    v_ip      const volatile int *
                vp      c_cp      const void *
                ip      c_ip      const int *
    -           vp      ip        void *
    + vp ip void * +
    footnotes
    @@ -5566,7 +5696,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. conditional-expression unary-expression assignment-operator assignment-expression assignment-operator: one of - = *= /= %= += -= <<= >>= &= ^= |= + = *= /= %= += -= <<= >>= &= ^= |= +
    Constraints

    An assignment operator shall have a modifiable lvalue as its left operand. @@ -5634,7 +5765,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. char c; /* ... */ if ((c = f()) == -1) - /* ... */ + /* ... */ + the int value returned by the function may be truncated when stored in the char, and then converted back to int width prior to the comparison. In an implementation in which ''plain'' char has the same range of values as unsigned char (and char is narrower than int), the result of the conversion cannot be @@ -5647,7 +5779,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. char c; int i; long l; - l = (c = i); + l = (c = i); + the value of i is converted to the type of the assignment expression c = i, that is, char type. The value of the expression enclosed in parentheses is then converted to the type of the outer assignment expression, that is, long int type. @@ -5660,7 +5793,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. const char c = 'A'; cpp = &p; // constraint violation *cpp = &c; // valid - *p = 0; // valid + *p = 0; // valid + The first assignment is unsafe because it would allow the following valid code to attempt to change the value of the const object c. @@ -5703,7 +5837,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. T result; do { result = tmp op (E2); - } while (!atomic_compare_exchange_strong(&E1, &tmp, result)); + } while (!atomic_compare_exchange_strong(&E1, &tmp, result)); + with result being the result of the operation. @@ -5713,7 +5848,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               expression:
                      assignment-expression
    -                 expression , assignment-expression
    + expression , assignment-expression +
    Semantics

    The left operand of a comma operator is evaluated as a void expression; there is a @@ -5725,7 +5861,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. of initializers). On the other hand, it can be used within a parenthesized expression or within the second expression of a conditional operator in such contexts. In the function call

    -          f(a, (t=3, t+2), c)
    + f(a, (t=3, t+2), c) + the function has three arguments, the second of which has the value 5.

    Forward references: initialization (6.7.9). @@ -5744,7 +5881,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               constant-expression:
    -                 conditional-expression
    + conditional-expression +
    Description

    A constant expression can be evaluated during translation rather than runtime, and @@ -5824,7 +5962,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    118) Thus, in the following initialization,

    -           static int i = 2 || 1 / 0;
    + static int i = 2 || 1 / 0; + the expression is a valid integer constant expression with value one. @@ -5846,7 +5985,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. init-declarator-list , init-declarator init-declarator: declarator - declarator = initializer + declarator = initializer +
    Constraints

    A declaration other than a static_assert declaration shall declare at least a declarator @@ -5902,7 +6042,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. static _Thread_local auto - register + register +

    Constraints

    At most, one storage-class specifier may be given in the declaration specifiers in a @@ -5965,7 +6106,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. atomic-type-specifier struct-or-union-specifier enum-specifier - typedef-name + typedef-name +

    Constraints

    At least one type specifier shall be given in the declaration specifiers in each declaration, @@ -6042,7 +6184,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. struct-declarator-list , struct-declarator struct-declarator: declarator - declaratoropt : constant-expression + declaratoropt : constant-expression +

    Constraints

    A struct-declaration that does not declare an anonymous structure or anonymous union @@ -6154,20 +6297,24 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. } v1; v1.i = 2; // valid v1.k = 3; // invalid: inner structure is not anonymous - v1.w.k = 5; // valid + v1.w.k = 5; // valid +

    EXAMPLE 2 After the declaration:

    -          struct s { int n; double d[]; };
    + struct s { int n; double d[]; }; + the structure struct s has a flexible array member d. A typical way to use this is:
               int m = /* some value */;
    -          struct s *p = malloc(sizeof (struct s) + sizeof (double [m]));
    + struct s *p = malloc(sizeof (struct s) + sizeof (double [m])); + and assuming that the call to malloc succeeds, the object pointed to by p behaves, for most purposes, as if p had been declared as:
    -          struct { int n; double d[m]; } *p;
    + struct { int n; double d[m]; } *p; + (there are circumstances in which this equivalence is broken; in particular, the offsets of member d might not be the same).

    @@ -6176,22 +6323,26 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. struct s t1 = { 0 }; // valid struct s t2 = { 1, { 4.2 }}; // invalid t1.n = 4; // valid - t1.d[0] = 4.2; // might be undefined behavior + t1.d[0] = 4.2; // might be undefined behavior + The initialization of t2 is invalid (and violates a constraint) because struct s is treated as if it did not contain member d. The assignment to t1.d[0] is probably undefined behavior, but it is possible that

    -          sizeof (struct s) >= offsetof(struct s, d) + sizeof (double)
    + sizeof (struct s) >= offsetof(struct s, d) + sizeof (double) + in which case the assignment would be legitimate. Nevertheless, it cannot appear in strictly conforming code.

    After the further declaration:

    -          struct ss { int n; };
    + struct ss { int n; }; + the expressions:
               sizeof (struct s) >= sizeof (struct ss)
    -          sizeof (struct s) >= offsetof(struct s, d)
    + sizeof (struct s) >= offsetof(struct s, d) + are always equal to 1.

    If sizeof (double) is 8, then after the following code is executed: @@ -6199,31 +6350,37 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. struct s *s1; struct s *s2; s1 = malloc(sizeof (struct s) + 64); - s2 = malloc(sizeof (struct s) + 46); + s2 = malloc(sizeof (struct s) + 46); + and assuming that the calls to malloc succeed, the objects pointed to by s1 and s2 behave, for most purposes, as if the identifiers had been declared as:

               struct { int n; double d[8]; } *s1;
    -          struct { int n; double d[5]; } *s2;
    + struct { int n; double d[5]; } *s2; +

    Following the further successful assignments:

               s1 = malloc(sizeof (struct s) + 10);
    -          s2 = malloc(sizeof (struct s) + 6);
    + s2 = malloc(sizeof (struct s) + 6); + they then behave as if the declarations were:
    -          struct { int n; double d[1]; } *s1, *s2;
    + struct { int n; double d[1]; } *s1, *s2; + and:
               double *dp;
               dp = &(s1->d[0]);          //   valid
               *dp = 42;                  //   valid
               dp = &(s2->d[0]);          //   valid
    -          *dp = 42;                  //   undefined behavior
    + *dp = 42; // undefined behavior +

    The assignment:

    -          *s1 = *s2;
    + *s1 = *s2; + only copies the member n; if any of the array elements are within the first sizeof (struct s) bytes of the structure, they might be copied or simply overwritten with indeterminate values. @@ -6260,7 +6417,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. enumerator-list , enumerator enumerator: enumeration-constant - enumeration-constant = constant-expression + enumeration-constant = constant-expression +
    Constraints

    The expression that defines the value of an enumeration constant shall be an integer @@ -6294,7 +6452,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. col = claret; cp = &col; if (*cp != burgundy) - /* ... */ + /* ... */ + makes hue the tag of an enumeration, and then declares col as an object that has that type and cp as a pointer to an object that has that type. The enumerated values are in the set { 0, 1, 20, 21 }. @@ -6318,7 +6477,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A type specifier of the form

    -         enum identifier
    + enum identifier + without an enumerator list shall only appear after the type it specifies is complete.
    Semantics

    @@ -6339,35 +6499,42 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    -          struct-or-union identifieropt { struct-declaration-list }
    + struct-or-union identifieropt { struct-declaration-list } + or
    -          enum identifieropt { enumerator-list }
    + enum identifieropt { enumerator-list } + or
    -          enum identifieropt { enumerator-list , }
    + enum identifieropt { enumerator-list , } + declares a structure, union, or enumerated type. The list defines the structure content, union content, or enumeration content. If an identifier is provided,130) the type specifier also declares the identifier to be the tag of that type.

    A declaration of the form

    -          struct-or-union identifier ;
    + struct-or-union identifier ; + specifies a structure or union type and declares the identifier as a tag of that type.131)

    If a type specifier of the form

    -          struct-or-union identifier
    + struct-or-union identifier + occurs other than as part of one of the above forms, and no other declaration of the identifier as a tag is visible, then it declares an incomplete structure or union type, and declares the identifier as the tag of that type.131)

    If a type specifier of the form

    -          struct-or-union identifier
    + struct-or-union identifier + or
    -          enum identifier
    + enum identifier + occurs other than as part of one of the above forms, and a declaration of the identifier as a tag is visible, then it specifies the same type as that other declaration, and does not redeclare the tag. @@ -6377,7 +6544,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. struct tnode { int count; struct tnode *left, *right; - }; + }; + specifies a structure that contains an integer and two pointers to objects of the same type. Once this declaration has been given, the declaration @@ -6386,7 +6554,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
    -          struct tnode s, *sp;
    + struct tnode s, *sp; + declares s to be an object of the given type and sp to be a pointer to an object of the given type. With these declarations, the expression sp->left refers to the left struct tnode pointer of the object to which sp points; the expression s.right->count designates the count member of the right struct @@ -6399,19 +6568,22 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. int count; TNODE *left, *right; }; - TNODE s, *sp; + TNODE s, *sp; +

    EXAMPLE 2 To illustrate the use of prior declaration of a tag to specify a pair of mutually referential structures, the declarations

               struct s1 { struct s2 *s2p; /* ... */ }; // D1
    -          struct s2 { struct s1 *s1p; /* ... */ }; // D2
    + struct s2 { struct s1 *s1p; /* ... */ }; // D2 + specify a pair of structures that contain pointers to each other. Note, however, that if s2 were already declared as a tag in an enclosing scope, the declaration D1 would refer to it, not to the tag s2 declared in D2. To eliminate this context sensitivity, the declaration
    -          struct s2;
    + struct s2; + may be inserted ahead of D1. This declares a new tag s2 in the inner scope; the declaration D2 then completes the specification of the new type. @@ -6436,7 +6608,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               atomic-type-specifier:
    -                 _Atomic ( type-name )
    + _Atomic ( type-name ) +
    Constraints

    Atomic type specifiers shall not be used if the implementation does not support atomic @@ -6459,7 +6632,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. const restrict volatile - _Atomic + _Atomic +

    Constraints

    Types other than pointer types whose referenced type is an object type shall not be @@ -6513,7 +6687,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 1 An object declared

    -          extern const volatile int real_time_clock;
    + extern const volatile int real_time_clock; + may be modifiable by hardware, but cannot be assigned to, incremented, or decremented.

    @@ -6531,7 +6706,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. pi = &ncs.mem; // valid pi = &cs.mem; // violates type constraints for = pci = &cs.mem; // valid - pi = a[0]; // invalid: a[0] has type ''const int *'' + pi = a[0]; // invalid: a[0] has type ''const int *'' + @@ -6539,7 +6715,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 3 The declaration

    -          _Atomic volatile int *p;
    + _Atomic volatile int *p; + specifies that p has the type ''pointer to volatile atomic int'', a pointer to a volatile-qualified atomic type. @@ -6598,7 +6775,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
               int * restrict a;
               int * restrict b;
    -          extern int c[];
    + extern int c[]; + assert that if an object is accessed using one of a, b, or c, and that object is modified anywhere in the program, then it is never accessed using either of the other two. @@ -6611,7 +6789,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. { while (n-- > 0) *p++ = *q++; - } + } + assert that, during each execution of the function, if an object is accessed through one of the pointer parameters, then it is not also accessed through the other.

    @@ -6626,7 +6805,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. extern int d[100]; f(50, d + 50, d); // valid f(50, d + 1, d); // undefined behavior - } + } +

    EXAMPLE 3 The function parameter declarations @@ -6636,7 +6816,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. int i; for (i = 0; i < n; i++) p[i] = q[i] + r[i]; - } + } + illustrate how an unmodified object can be aliased through two restricted pointers. In particular, if a and b are disjoint arrays, a call of the form h(100, a, b, b) has defined behavior, because array b is not modified within function h. @@ -6657,7 +6838,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. p1 = q2; // undefined behavior p2 = q2; // undefined behavior } - } + } +

    The one exception allows the value of a restricted pointer to be carried out of the block in which it (or, more precisely, the ordinary identifier used to designate it) is declared when that block finishes execution. For @@ -6670,7 +6852,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. t.n = n; t.v = malloc(n * sizeof (float)); return t; - } + } +

    footnotes
    @@ -6686,7 +6869,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
               function-specifier:
                      inline
    -                 _Noreturn
    + _Noreturn +
    Constraints

    Function specifiers shall be used only in the declaration of an identifier for a function. @@ -6744,7 +6928,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. { /* A translator may perform inline substitutions */ return is_fahr ? cels(temp) : fahr(temp); - } + } +

    Note that the definition of fahr is an external definition because fahr is also declared with extern, but the definition of cels is an inline definition. Because cels has external linkage and is referenced, an @@ -6764,7 +6949,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. } _Noreturn void g (int i) { // causes undefined behavior if i <= 0 if (i > 0) abort(); - } + } +

    Forward references: function definitions (6.9.1). @@ -6791,7 +6977,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               alignment-specifier:
                     _Alignas ( type-name )
    -                _Alignas ( constant-expression )
    + _Alignas ( constant-expression ) +
    Constraints

    An alignment attribute shall not be specified in a declaration of a typedef, or a bit-field, or @@ -6861,7 +7048,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. declaration-specifiers abstract-declaratoropt identifier-list: identifier - identifier-list , identifier + identifier-list , identifier +

    Semantics

    Each declarator declares one identifier, and asserts that when an operand of the same @@ -6877,19 +7065,22 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    In the following subclauses, consider a declaration

    -         T D1
    + T D1 + where T contains the declaration specifiers that specify a type T (such as int) and D1 is a declarator that contains an identifier ident. The type specified for the identifier ident in the various forms of declarator is described inductively using this notation.

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

    -         identifier
    + identifier + then the type specified for ident is T .

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

    -         ( D )
    + ( D ) + 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. @@ -6905,7 +7096,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    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. @@ -6918,7 +7110,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
               const int *ptr_to_constant;
    -          int *const constant_ptr;
    + int *const constant_ptr; + The contents of any object pointed to by ptr_to_constant shall not be modified through that pointer, but ptr_to_constant itself may be changed to point to another object. Similarly, the contents of the int pointed to by constant_ptr may be modified, but constant_ptr itself shall always point to the @@ -6928,7 +7121,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. type ''pointer to int''.
               typedef int *int_ptr;
    -          const int_ptr constant_ptr;
    + const int_ptr constant_ptr; + declares constant_ptr as an object that has type ''const-qualified pointer to int''. @@ -6954,7 +7148,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 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 ''.142) (See 6.7.6.3 for the meaning of the optional type qualifiers and the keyword static.) @@ -6985,14 +7180,16 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 1

    -          float fa[11], *afp[17];
    + float fa[11], *afp[17]; + declares an array of float numbers and an array of pointers to float numbers.

    EXAMPLE 2 Note the distinction between the declarations

               extern int *x;
    -          extern int y[];
    + extern int y[]; + The first declares x to be a pointer to int; the second declares y to be an array of int of unspecified size (an incomplete type), the storage for which is defined elsewhere. @@ -7010,7 +7207,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. p = a; // invalid: not compatible because 4 != 6 r = c; // compatible, but defined behavior only if // n == 6 and m == n+1 - } + } + @@ -7042,7 +7240,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. int (*s)[m]; // valid: auto pointer to VLA extern int (*r)[m]; // invalid: r has linkage and points to VLA static int (*q)[m] = &B; // valid: q is a static block pointer to VLA - } + } +

    Forward references: function declarators (6.7.6.3), function definitions (6.9.1), initialization (6.7.9). @@ -7071,10 +7270,12 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. If, in the declaration ''T D1'', D1 has the form

    -        D( parameter-type-list )
    + D( parameter-type-list ) + 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 ''. @@ -7137,7 +7338,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 1 The declaration

    -          int f(void), *fip(), (*pfi)();
    + int f(void), *fip(), (*pfi)(); + declares a function f with no parameters returning an int, a function fip with no parameter specification returning a pointer to an int, and a pointer pfi to a function with no parameter specification returning an int. It is especially useful to compare the last two. The binding of *fip() is *(fip()), so that the @@ -7154,7 +7356,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 2 The declaration

    -          int (*apfi[3])(int *x, int *y);
    + int (*apfi[3])(int *x, int *y); + declares an array apfi of three pointers to functions returning int. Each of these functions has two parameters that are pointers to int. The identifiers x and y are declared for descriptive purposes only and go out of scope at the end of the declaration of apfi. @@ -7162,7 +7365,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 3 The declaration

    -          int (*fpfi(int (*)(long), int))(int, ...);
    + int (*fpfi(int (*)(long), int))(int, ...); + declares a function fpfi that returns a pointer to a function returning an int. The function fpfi has two parameters: a pointer to a function returning an int (with one parameter of type long int), and an int. The pointer returned by fpfi points to a function that has one int parameter and accepts zero or more @@ -7189,7 +7393,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. for (int j = 0, k = n*m+300; j < k; j++) // a is a pointer to a VLA with n*m+300 elements a[i][j] += x; - } + } +

    EXAMPLE 5 The following are all compatible function prototype declarators. @@ -7197,13 +7402,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. double maximum(int n, int m, double a[n][m]); double maximum(int n, int m, double a[*][*]); double maximum(int n, int m, double a[ ][*]); - double maximum(int n, int m, double a[ ][m]); + double maximum(int n, int m, double a[ ][m]); + as are:

                void   f(double     (* restrict a)[5]);
                void   f(double     a[restrict][5]);
                void   f(double     a[restrict 3][5]);
    -           void   f(double     a[restrict static 3][5]);
    + void f(double a[restrict static 3][5]); + (Note that the last declaration also specifies that the argument corresponding to a in any call to f must be a non-null pointer to the first of at least three arrays of 5 doubles, which the others do not.) @@ -7237,7 +7444,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. direct-abstract-declaratoropt [ type-qualifier-list static assignment-expression ] direct-abstract-declaratoropt [ * ] - direct-abstract-declaratoropt ( parameter-type-listopt ) + direct-abstract-declaratoropt ( parameter-type-listopt ) +
    Semantics

    In several contexts, it is necessary to specify a type. This is accomplished using a type @@ -7253,7 +7461,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. (e) int (*)[*] (f) int *() (g) int (*)(void) - (h) int (*const [])(unsigned int, ...) + (h) int (*const [])(unsigned int, ...) + name respectively the types (a) int, (b) pointer to int, (c) array of three pointers to int, (d) pointer to an array of three ints, (e) pointer to a variable length array of an unspecified number of ints, (f) function with no parameter specification returning a pointer to int, (g) pointer to function with no parameters @@ -7276,7 +7485,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               typedef-name:
    -                 identifier
    + identifier +
    Constraints

    If a typedef name specifies a variably modified type then it shall have block scope. @@ -7290,7 +7500,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. synonym for the type so specified. That is, in the following declarations:

               typedef T type_ident;
    -          type_ident D;
    + type_ident D; + type_ident is defined as a typedef name with the type specified by the declaration specifiers in T (known as T ), and the identifier in D has the type ''derived-declarator- type-list T '' where the derived-declarator-type-list is specified by the declarators of D. A @@ -7300,13 +7511,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE 1 After
               typedef int MILES, KLICKSP();
    -          typedef struct { double hi, lo; } range;
    + typedef struct { double hi, lo; } range; + the constructions
               MILES distance;
               extern KLICKSP *metricp;
               range x;
    -          range z, *zp;
    + range z, *zp; + are all valid declarations. The type of distance is int, that of metricp is ''pointer to function with no parameter specification returning int'', and that of x and z is the specified structure; zp is a pointer to such a structure. The object distance has a type compatible with any other int object. @@ -7315,7 +7528,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE 2 After the declarations
               typedef struct s1 { int x; } t1, *tp1;
    -          typedef struct s2 { int x; } t2, *tp2;
    + typedef struct s2 { int x; } t2, *tp2; + type t1 and the type pointed to by tp1 are compatible. Type t1 is also compatible with type struct s1, but not compatible with the types struct s2, t2, the type pointed to by tp2, or int. @@ -7328,7 +7542,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. unsigned t:4; const t:5; plain r:5; - }; + }; + declare a typedef name t with type signed int, a typedef name plain with type int, and a structure with three bit-field members, one named t that contains values in the range [0, 15], an unnamed const- qualified bit-field which (if it could be accessed) would contain values in either the range [-15, +15] or @@ -7339,7 +7554,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. in an inner scope by
               t f(t (t));
    -          long t;
    + long t; + then a function f is declared with type ''function returning signed int with one unnamed parameter with type pointer to function returning signed int with one unnamed parameter with type signed int'', and an identifier t with type long int. @@ -7352,7 +7568,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. typedef void fv(int), (*pfv)(int); void (*signal(int, void (*)(int)))(int); fv *signal(int, fv *); - pfv signal(int, pfv); + pfv signal(int, pfv); +

    EXAMPLE 5 If a typedef name denotes a variable length array type, the length of the array is fixed at the @@ -7367,7 +7584,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. int b[n]; // a and b are different sizes for (int i = 1; i < n; i++) a[i-1] = b[i]; - } + } +

    6.7.9 Initialization

    Syntax
    @@ -7387,7 +7605,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. designator-list designator designator: [ constant-expression ] - . identifier + . identifier +
    Constraints

    No initializer shall attempt to provide a value for an object not contained within the entity @@ -7404,14 +7623,16 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    If a designator has the form

    -          [ constant-expression ]
    + [ constant-expression ] + then the current object (defined below) shall have array type and the expression shall be an integer constant expression. If the array is of unknown size, any nonnegative value is valid.

    If a designator has the form

    -          . identifier
    + . identifier + then the current object (defined below) shall have structure or union type and the identifier shall be the name of a member of that type. @@ -7511,13 +7732,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE 1 Provided that <complex.h> has been #included, the declarations
               int i = 3.5;
    -          double complex c = 5 + 3 * I;
    + double complex c = 5 + 3 * I; + define and initialize i with the value 3 and c with the value 5.0 + i3.0.

    EXAMPLE 2 The declaration

    -          int x[] = { 1, 3, 5 };
    + int x[] = { 1, 3, 5 }; + defines and initializes x as a one-dimensional array object that has three elements, as no size was specified and there are three initializers. @@ -7528,7 +7751,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. { 1, 3, 5 }, { 2, 4, 6 }, { 3, 5, 7 }, - }; + }; + is a definition with a fully bracketed initialization: 1, 3, and 5 initialize the first row of y (the array object y[0]), namely y[0][0], y[0][1], and y[0][2]. Likewise the next two lines initialize y[1] and y[2]. The initializer ends early, so y[3] is initialized with zeros. Precisely the same effect could have @@ -7536,8 +7760,9 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
               int y[4][3] = {
                     1, 3, 5, 2, 4, 6, 3, 5, 7
    -          };
    - The initializer for y[0] does not begin with a left brace, so three items from the list are used. Likewise the + }; + + The initializer for y[0] does not begin with a left brace, so three items from the list are used. Likewise the next three are taken successively for y[1] and y[2].

    @@ -7545,13 +7770,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               int z[4][3] = {
                     { 1 }, { 2 }, { 3 }, { 4 }
    -          };
    + }; + initializes the first column of z as specified and initializes the rest with zeros.

    EXAMPLE 5 The declaration

    -          struct { int a[3], b; } w[] = { { 1 }, 2 };
    + struct { int a[3], b; } w[] = { { 1 }, 2 }; + is a definition with an inconsistently bracketed initialization. It defines an array with two element @@ -7566,7 +7793,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. { 1 }, { 2, 3 }, { 4, 5, 6 } - }; + }; + contains an incompletely but consistently bracketed initialization. It defines a three-dimensional array object: q[0][0][0] is 1, q[1][0][0] is 2, q[1][0][1] is 3, and 4, 5, and 6 initialize q[2][0][0], q[2][0][1], and q[2][1][0], respectively; all the rest are zero. The initializer for @@ -7580,7 +7808,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 1, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 4, 5, 6 - }; + }; + or by:
                short q[4][3][2] = {
    @@ -7594,7 +7823,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                            { 4, 5 },
                            { 6 },
                      }
    -           };
    + }; + in a fully bracketed form.

    Note that the fully bracketed and minimally bracketed forms of initialization are, in general, less likely to @@ -7604,27 +7834,33 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE 7 One form of initialization that completes array types involves typedef names. Given the declaration

    -           typedef int A[];          // OK - declared with block scope
    + typedef int A[]; // OK - declared with block scope + the declaration
    -           A a = { 1, 2 }, b = { 3, 4, 5 };
    + A a = { 1, 2 }, b = { 3, 4, 5 }; + is identical to
    -           int a[] = { 1, 2 }, b[] = { 3, 4, 5 };
    + int a[] = { 1, 2 }, b[] = { 3, 4, 5 }; + due to the rules for incomplete types.

    EXAMPLE 8 The declaration

    -          char s[] = "abc", t[3] = "abc";
    + char s[] = "abc", t[3] = "abc"; + defines ''plain'' char array objects s and t whose elements are initialized with character string literals. This declaration is identical to
               char s[] = { 'a', 'b', 'c', '\0' },
    -               t[] = { 'a', 'b', 'c' };
    + t[] = { 'a', 'b', 'c' }; + The contents of the arrays are modifiable. On the other hand, the declaration
    -          char *p = "abc";
    + char *p = "abc"; + defines p with type ''pointer to char'' and initializes it to point to an object with type ''array of char'' with length 4 whose elements are initialized with a character string literal. If an attempt is made to use p to modify the contents of the array, the behavior is undefined. @@ -7637,26 +7873,30 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. const char *nm[] = { [member_two] = "member two", [member_one] = "member one", - }; + }; +

    EXAMPLE 10 Structure members can be initialized to nonzero values without depending on their order:

    -          div_t answer = { .quot = 2, .rem = -1 };
    + div_t answer = { .quot = 2, .rem = -1 }; +

    EXAMPLE 11 Designators can be used to provide explicit initialization when unadorned initializer lists might be misunderstood:

               struct { int a[3], b; } w[] =
    -                { [0].a = {1}, [1].a[0] = 2 };
    + { [0].a = {1}, [1].a[0] = 2 }; +

    EXAMPLE 12 Space can be ''allocated'' from both ends of an array by using a single designator:

               int a[MAX] = {
                     1, 3, 5, 7, 9, [MAX-5] = 8, 6, 4, 2, 0
    -          };
    + }; +

    In the above, if MAX is greater than ten, there will be some zero-valued elements in the middle; if it is less than ten, some of the values provided by the first five initializers will be overridden by the second five. @@ -7664,7 +7904,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE 13 Any member of a union can be initialized:

    -          union { /* ... */ } u = { .any_member = 42 };
    + union { /* ... */ } u = { .any_member = 42 }; +

    Forward references: common definitions <stddef.h> (7.19). @@ -7691,7 +7932,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               static_assert-declaration:
    -                  _Static_assert ( constant-expression , string-literal ) ;
    + _Static_assert ( constant-expression , string-literal ) ; +
    Constraints

    The constant expression shall compare unequal to 0. @@ -7715,7 +7957,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. expression-statement selection-statement iteration-statement - jump-statement + jump-statement +

    Semantics

    A statement specifies an action to be performed. Except as indicated, statements are @@ -7745,7 +7988,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. labeled-statement: identifier : statement case constant-expression : statement - default : statement + default : statement +

    Constraints

    A case or default label shall appear only in a switch statement. Further @@ -7771,7 +8015,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. block-item-list block-item block-item: declaration - statement + statement +

    Semantics

    A compound statement is a block. @@ -7781,7 +8026,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               expression-statement:
    -                 expressionopt ;
    + expressionopt ; +
    Semantics

    The expression in an expression statement is evaluated as a void expression for its side @@ -7795,7 +8041,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               int p(int);
               /* ... */
    -          (void)p(0);
    + (void)p(0); + @@ -7806,7 +8053,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. char *s; /* ... */ while (*s++ != '\0') - ; + ; + a null statement is used to supply an empty loop body to the iteration statement.

    @@ -7823,7 +8071,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. } /* ... */ end_loop1: ; - } + } +

    Forward references: iteration statements (6.8.5). @@ -7838,7 +8087,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. selection-statement: if ( expression ) statement if ( expression ) statement else statement - switch ( expression ) statement + switch ( expression ) statement +

    Semantics

    A selection statement selects among a set of statements depending on the value of a @@ -7913,7 +8163,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. /* falls through into default code */ default: printf("%d\n", i); - } + } + the object whose identifier is i exists with automatic storage duration (within the block) but is never initialized, and thus if the controlling expression has a nonzero value, the call to the printf function will access an indeterminate value. Similarly, the call to the function f cannot be reached. @@ -7932,7 +8183,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. while ( expression ) statement do statement while ( expression ) ; for ( expressionopt ; expressionopt ; expressionopt ) statement - for ( declaration expressionopt ; expressionopt ) statement + for ( declaration expressionopt ; expressionopt ) statement +

    Constraints

    The controlling expression of an iteration statement shall have scalar type. @@ -7981,7 +8233,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    The statement

    -          for ( clause-1 ; expression-2 ; expression-3 ) statement
    + for ( clause-1 ; expression-2 ; expression-3 ) statement + behaves as follows: The expression expression-2 is the controlling expression that is evaluated before each execution of the loop body. The expression expression-3 is evaluated as a void expression after each execution of the loop body. If clause-1 is a @@ -8008,7 +8261,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. goto identifier ; continue ; break ; - return expressionopt ; + return expressionopt ; + @@ -8053,7 +8307,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. } // handle other operations /* ... */ - } + } +

    EXAMPLE 2 A goto statement is not allowed to jump past any declarations of objects with variably @@ -8070,7 +8325,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. lab4: a[j] = 6.6; } - goto lab4; // invalid: going INTO scope of VLA. + goto lab4; // invalid: going INTO scope of VLA. +

    6.8.6.2 The continue statement
    @@ -8086,7 +8342,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
         /* ... */                            /* ... */                            /* ... */
         continue;                            continue;                            continue;
    -    /* ... */                            /* ... */                            /* ... */
    + /* ... */ /* ... */ /* ... */ + contin: ; contin: ; contin: ; } } while (/* ... */); } unless the continue statement shown is in an enclosed iteration statement (in which @@ -8143,7 +8400,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. return g.u1.f2; } /* ... */ - g.u2.f3 = f(); + g.u2.f3 = f(); + there is no undefined behavior, although there would be if the assignment were done directly (without using a function call to fetch the value). @@ -8167,7 +8425,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. translation-unit external-declaration external-declaration: function-definition - declaration + declaration +
    Constraints

    The storage-class specifiers auto and register shall not appear in the declaration @@ -8211,7 +8470,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. declaration-specifiers declarator declaration-listopt compound-statement declaration-list: declaration - declaration-list declaration + declaration-list declaration +

    Constraints

    The identifier declared in a function definition (which is the name of the function) shall @@ -8271,11 +8531,13 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. extern int max(int a, int b) { return a > b ? a : b; - } + } + extern is the storage-class specifier and int is the type specifier; max(int a, int b) is the function declarator; and

    -          { return a > b ? a : b; }
    + { return a > b ? a : b; } + is the function body. The following similar definition uses the identifier-list form for the parameter declarations: @@ -8288,7 +8550,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. int a, b; { return a > b ? a : b; - } + } + Here int a, b; is the declaration list for the parameters. The difference between these two definitions is that the first form acts as a prototype declaration that forces conversion of the arguments of subsequent calls to the function, whereas the second form does not. @@ -8298,21 +8561,24 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                           int f(void);
                           /* ... */
    -                      g(f);
    + g(f); + Then the definition of g might read
               void g(int (*funcp)(void))
               {
                     /* ... */
                     (*funcp)(); /* or funcp(); ...                    */
    -          }
    + } + or, equivalently,
               void g(int func(void))
               {
                     /* ... */
                     func(); /* or (*func)(); ...                   */
    -          }
    + } +
    footnotes
    @@ -8329,7 +8595,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. F *e(void) { /* ... */ } // e returns a pointer to a function F *((e))(void) { /* ... */ } // same: parentheses irrelevant int (*fp)(void); // fp points to a function that has type F - F *Fp; // Fp points to a function that has type F + F *Fp; // Fp points to a function that has type F +

    163) See ''future language directions'' (6.11.7). @@ -8370,12 +8637,14 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. extern int i2; // refers to previous, whose linkage is internal extern int i3; // refers to previous, whose linkage is external extern int i4; // refers to previous, whose linkage is external - extern int i5; // refers to previous, whose linkage is internal + extern int i5; // refers to previous, whose linkage is internal +

    EXAMPLE 2 If at the end of the translation unit containing

    -          int i[];
    + int i[]; + the array i still has incomplete type, the implicit initializer causes it to have one element, which is set to zero on program startup. @@ -8435,7 +8704,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. preprocessing-token pp-tokens preprocessing-token new-line: - the new-line character + the new-line character +
    Description

    A preprocessing directive consists of a sequence of preprocessing tokens that satisfies the @@ -8474,7 +8744,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE In:

                #define EMPTY
    -           EMPTY # include <file.h>
    + EMPTY # include <file.h> + the sequence of preprocessing tokens on the second line is not a preprocessing directive, because it does not begin with a # at the start of translation phase 4, even though it will do so after the macro EMPTY has been replaced. @@ -8493,10 +8764,12 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. except that: identifiers (including those lexically identical to keywords) are interpreted as * described below;166) and it may contain unary operator expressions of the form
    -      defined identifier
    + defined identifier + or
    -      defined ( identifier )
    + defined ( identifier ) + which evaluate to 1 if the identifier is currently defined as a macro name (that is, if it is @@ -8512,7 +8785,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. Preprocessing directives of the forms
         # if   constant-expression new-line groupopt
    -    # elif 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 @@ -8542,7 +8816,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. Preprocessing directives of the forms

         # ifdef identifier new-line groupopt
    -    # ifndef 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. @@ -8585,7 +8860,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A preprocessing directive of the form

    -    # include <h-char-sequence> new-line
    + # include <h-char-sequence> new-line + searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the < and > delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header @@ -8593,7 +8869,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A preprocessing directive of the form

    -    # include "q-char-sequence" new-line
    + # include "q-char-sequence" new-line + causes the replacement of that directive by the entire contents of the source file identified by the specified sequence between the " delimiters. The named source file is searched @@ -8602,13 +8879,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read
    -    # include <h-char-sequence> new-line
    + # include <h-char-sequence> new-line + with the identical contained sequence (including > characters, if any) from the original directive.

    A preprocessing directive of the form

    -    # include pp-tokens new-line
    + # include pp-tokens new-line + (that does not match one of the two previous forms) is permitted. The preprocessing tokens after include in the directive are processed just as in normal text. (Each identifier currently defined as a macro name is replaced by its replacement list of @@ -8630,7 +8909,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. EXAMPLE 1 The most common uses of #include preprocessing directives are as in the following:
               #include <stdio.h>
    -          #include "myprog.h"
    + #include "myprog.h" + @@ -8646,7 +8926,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #else #define INCFILE "versN.h" #endif - #include INCFILE + #include INCFILE +

    Forward references: macro replacement (6.10.3). @@ -8698,7 +8979,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A preprocessing directive of the form

    -    # define identifier replacement-list new-line
    + # define identifier replacement-list new-line + defines an object-like macro that causes each subsequent instance of the macro name171) to be replaced by the replacement list of preprocessing tokens that constitute the remainder of the directive. The replacement list is then rescanned for more macro names @@ -8708,7 +8990,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
         # 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
    + # define identifier lparen identifier-list , ... ) replacement-list new-line + defines a function-like macro with parameters, whose use is similar syntactically to a function call. 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 @@ -8814,14 +9097,16 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #define in_between(a) mkstr(a) #define join(c, d) in_between(c hash_hash d) char p[] = join(x, y); // equivalent to - // char p[] = "x ## y"; + // char p[] = "x ## y"; + The expansion produces, at various stages:
              join(x, y)
              in_between(x hash_hash y)
              in_between(x ## y)
              mkstr(x ## y)
    -         "x ## y"
    + "x ## y" + In other words, expanding hash_hash produces a new token, consisting of two adjacent sharp signs, but this new token is not the ## operator. @@ -8859,14 +9144,16 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A preprocessing directive of the form

    -    # undef identifier new-line
    + # undef identifier new-line + causes the specified identifier no longer to be defined as a macro name. It is ignored if the specified identifier is not currently defined as a macro name.

    EXAMPLE 1 The simplest use of this facility is to define a ''manifest constant'', as in

              #define TABSIZE 100
    -         int table[TABSIZE];
    + int table[TABSIZE]; +

    EXAMPLE 2 The following defines a function-like macro whose value is the maximum of its arguments. @@ -8875,7 +9162,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. arguments a second time (including side effects) and generating more code than a function if invoked several times. It also cannot have its address taken, as it has none.

    -         #define max(a, b) ((a) > (b) ? (a) : (b))
    + #define max(a, b) ((a) > (b) ? (a) : (b)) + The parentheses ensure that the arguments and the resulting expression are bound properly.

    @@ -8899,13 +9187,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. g(x+(3,4)-w) | h 5) & m (f)^m(m); p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) }; - char c[2][6] = { str(hello), str() }; + char c[2][6] = { str(hello), str() }; + results in

               f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
               f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
               int i[] = { 1, 23, 4, 5, };
    -          char c[2][6] = { "hello", "" };
    + char c[2][6] = { "hello", "" }; +

    EXAMPLE 4 To illustrate the rules for creating character string literals and concatenating tokens, the @@ -8925,7 +9215,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. == 0) str(: @\n), s); #include xstr(INCFILE(2).h) glue(HIGH, LOW); - xglue(HIGH, LOW) + xglue(HIGH, LOW) + results in

    @@ -8935,7 +9226,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                 s);
               #include "vers2.h"    (after macro replacement, before file access)
               "hello";
    -          "hello" ", world"
    + "hello" ", world" + or, after concatenation of the character string literals,
               printf("x1= %d, x2= %s", x1, x2);
    @@ -8944,7 +9236,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                 s);
               #include "vers2.h"    (after macro replacement, before file access)
               "hello";
    -          "hello, world"
    + "hello, world" + Space around the # and ## tokens in the macro definition is optional.

    @@ -8952,11 +9245,13 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               #define t(x,y,z) x ## y ## z
               int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,),
    -                     t(10,,), t(,11,), t(,,12), t(,,) };
    + t(10,,), t(,11,), t(,,12), t(,,) }; + results in
               int j[] = { 123, 45, 67, 89,
    -                      10, 11, 12, };
    + 10, 11, 12, }; +

    EXAMPLE 6 To demonstrate the redefinition rules, the following sequence is valid. @@ -8966,13 +9261,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #define FUNC_LIKE(a) ( a ) #define FUNC_LIKE( a )( /* note the white space */ \ a /* other stuff on this line - */ ) + */ ) + But the following redefinitions are invalid:

               #define      OBJ_LIKE    (0)     // different token sequence
               #define      OBJ_LIKE    (1 - 1) // different white space
               #define      FUNC_LIKE(b) ( a ) // different parameter usage
    -          #define      FUNC_LIKE(b) ( b ) // different parameter spelling
    + #define FUNC_LIKE(b) ( b ) // different parameter spelling +

    EXAMPLE 7 Finally, to show the variable argument list macro facilities: @@ -8985,14 +9282,16 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. debug("Flag"); debug("X = %d\n", x); showlist(The first, second, and third items.); - report(x>y, "x is %d but y is %d", x, y); + report(x>y, "x is %d but y is %d", x, y); + results in

               fprintf(stderr, "Flag" );
               fprintf(stderr, "X = %d\n", x );
               puts( "The first, second, and third items." );
               ((x>y)?puts("x>y"):
    -                      printf("x is %d but y is %d", x, y));
    + printf("x is %d but y is %d", x, y)); +

    6.10.4 Line control

    @@ -9007,7 +9306,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A preprocessing directive of the form

    -    # line digit-sequence new-line
    + # line digit-sequence new-line + causes the implementation to behave as if the following sequence of source lines begins with a source line that has a line number as specified by the digit sequence (interpreted as a decimal integer). The digit sequence shall not specify zero, nor a number greater than @@ -9015,13 +9315,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    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.

    A preprocessing directive of the form

    -    # line pp-tokens new-line
    + # line pp-tokens new-line + (that does not match one of the two previous forms) is permitted. The preprocessing tokens after line on the directive are processed just as in normal text (each identifier currently defined as a macro name is replaced by its replacement list of preprocessing @@ -9034,7 +9336,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    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. @@ -9043,7 +9346,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    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)174) causes the implementation to behave in an implementation-defined manner. The behavior might cause translation to fail or cause the @@ -9059,7 +9363,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #pragma STDC FENV_ACCESS on-off-switch #pragma STDC CX_LIMITED_RANGE on-off-switch on-off-switch: one of - ON OFF DEFAULT + ON OFF DEFAULT +

    Forward references: the FP_CONTRACT pragma (7.12.2), the FENV_ACCESS pragma (7.6.1), the CX_LIMITED_RANGE pragma (7.3.4). @@ -9083,7 +9388,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A preprocessing directive of the form

    -    # new-line
    + # new-line + has no effect.

    6.10.8 Predefined macro names

    @@ -9113,15 +9419,18 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 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. + shall be supplied. + __FILE__ The presumed name of the current source file (a character string literal).177) __LINE__ The presumed line number (within the current source file) of the current
    -            source line (an integer constant).177)
    + source line (an integer constant).177) + __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.
    + implementation or the integer constant 0 if it is not. + @@ -9132,7 +9441,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.
                 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. +

    Forward references: the asctime function (7.26.3.1).

    footnotes
    @@ -9155,22 +9465,26 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. 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. If some other encoding is used, the macro shall not be defined and - the actual encoding used is implementation-defined. + the actual encoding used is implementation-defined. + __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.
    + integer character constant. + __STDC_UTF_16__ The integer constant 1, intended to indicate that values of type
                char16_t are UTF-16 encoded. If some other encoding is used, the
                macro shall not be defined and the actual encoding used is implementation-
    -           defined.
    + defined. + __STDC_UTF_32__ The integer constant 1, intended to indicate that values of type
                char32_t are UTF-32 encoded. If some other encoding is used, the
                macro shall not be defined and the actual encoding used is implementation-
    -           defined.
    + defined. +

    Forward references: common definitions (7.19), unicode utilities (7.27). @@ -9183,30 +9497,37 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. The following macro names are conditionally defined by the implementation: __STDC_ANALYZABLE__ The integer constant 1, intended to indicate conformance to

    -           the specifications in annex L (Analyzability).
    + the specifications in annex L (Analyzability). + __STDC_IEC_559__ The integer constant 1, intended to indicate conformance to the
    -           specifications in annex F (IEC 60559 floating-point arithmetic).
    + 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 annex G (IEC 60559 compatible complex
    -           arithmetic).
    + arithmetic). + __STDC_LIB_EXT1__ The integer constant 201ymmL, intended to indicate support
    -           for the extensions defined in annex K (Bounds-checking interfaces).179)
    + for the extensions defined in annex K (Bounds-checking interfaces).179) + __STDC_NO_COMPLEX__ The integer constant 1, intended to indicate that the
                implementation does not support complex types or the <complex.h>
    -           header.
    + header. + __STDC_NO_THREADS__ The integer constant 1, intended to indicate that the
                implementation does not support atomic types (including the _Atomic
                type qualifier and the <stdatomic.h> header) or the <threads.h>
    -           header.
    + header. + __STDC_NO_VLA__ The integer constant 1, intended to indicate that the
                implementation does not support variable length arrays or variably
    -           modified types.
    + modified types. +

    An implementation that defines __STDC_NO_COMPLEX__ shall not define __STDC_IEC_559_COMPLEX__. @@ -9221,7 +9542,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    A unary operator expression of the form:

    -    _Pragma ( string-literal )
    + _Pragma ( string-literal ) + is processed as follows: The string literal is destringized by deleting the L prefix, if present, deleting the leading and trailing double-quotes, replacing each escape sequence \" by a double-quote, and replacing each escape sequence \\ by a single backslash. The @@ -9235,17 +9557,20 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    EXAMPLE A directive of the form:

    -           #pragma listing on "..\listing.dir"
    + #pragma listing on "..\listing.dir" + can also be expressed as:
    -           _Pragma ( "listing on \"..\\listing.dir\"" )
    + _Pragma ( "listing on \"..\\listing.dir\"" ) + The latter form is processed in the same way whether it appears literally as shown, or results from macro replacement, as in:
                #define LISTING(x) PRAGMA(listing on #x)
                #define PRAGMA(x) _Pragma(#x)
    -           LISTING ( ..\listing.dir )
    + LISTING ( ..\listing.dir ) +

    6.11 Future language directions

    @@ -9357,7 +9682,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. <errno.h> <math.h> <stddef.h> <time.h> <fenv.h> <setjmp.h> <stdint.h> <uchar.h> <float.h> <signal.h> <stdio.h> <wchar.h> - <inttypes.h> <stdalign.h> <stdlib.h> <wctype.h> + <inttypes.h> <stdalign.h> <stdlib.h> <wctype.h> +

    If a file with the same name as one of the above < and > delimited sequences, not provided as part of the implementation, is placed in any of the standard places that are @@ -9494,7 +9820,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <stdlib.h> const char *str; /* ... */ - i = atoi(str); + i = atoi(str); +

  • by use of its associated header (assuredly generating a true function reference) @@ -9506,20 +9833,23 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #undef atoi const char *str; /* ... */ - i = atoi(str); + i = atoi(str); + or
                #include <stdlib.h>
                const char *str;
                /* ... */
    -           i = (atoi)(str);
    + i = (atoi)(str); +
  • by explicit declaration
                extern int atoi(const char *);
                const char *str;
                /* ... */
    -           i = atoi(str);
    + i = atoi(str); +
    footnotes
    @@ -9534,13 +9864,15 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. appropriate header could specify
    -           #define abs(x) _BUILTIN_abs(x)
    + #define abs(x) _BUILTIN_abs(x) + for a compiler whose code generator will accept it. In this manner, a user desiring to guarantee that a given library function such as abs will be a genuine function may write
    -           #undef abs
    + #undef abs + whether the implementation's header provides a macro implementation of abs or a built-in implementation. The prototype for the function, which precedes and is hidden by any macro definition, is thereby revealed also. @@ -9559,12 +9891,14 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. The header <assert.h> defines the assert and static_assert macros and refers to another macro,
    -         NDEBUG
    + NDEBUG + which is not defined by <assert.h>. If NDEBUG is defined as a macro name at the point in the source file where <assert.h> is included, the assert macro is defined simply as
    -         #define assert(ignore) ((void)0)
    + #define assert(ignore) ((void)0) + The assert macro is redefined according to the current state of NDEBUG each time that <assert.h> is included.

    @@ -9574,7 +9908,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    The macro

    -         static_assert
    + static_assert + expands to _Static_assert.

    7.2.1 Program diagnostics

    @@ -9584,7 +9919,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <assert.h>
    -         void assert(scalar expression);
    + void assert(scalar expression); +
    Description

    The assert macro puts diagnostic tests into programs; it expands to a void expression. @@ -9627,26 +9963,31 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    The macro

    -          complex
    + complex + expands to _Complex; the macro
    -          _Complex_I
    + _Complex_I + expands to a constant expression of type const float _Complex, with the value of the imaginary unit.193)

    The macros

    -          imaginary
    + imaginary + and
    -          _Imaginary_I
    + _Imaginary_I + are defined if and only if the implementation supports imaginary types;194) if defined, they expand to _Imaginary and a constant expression of type const float _Imaginary with the value of the imaginary unit.

    The macro

    -          I
    + I + expands to either _Imaginary_I or _Complex_I. If _Imaginary_I is not defined, I shall expand to _Complex_I.

    @@ -9693,7 +10034,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

             #include <complex.h>
    -        #pragma STDC CX_LIMITED_RANGE on-off-switch
    + #pragma STDC CX_LIMITED_RANGE on-off-switch +
    Description

    The usual mathematical formulas for complex multiply, divide, and absolute value are @@ -9719,7 +10061,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. (x + iy) x (u + iv) = (xu - yv) + i(yu + xv) (x + iy) / (u + iv) = [(xu + yv) + i(yu - xv)]/(u2 + v 2 ) | x + iy | = (sqrt) x 2 + y 2 - ----- + ----- + where the programmer can determine they are safe. @@ -9732,7 +10075,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex cacos(double complex z); float complex cacosf(float complex z); - long double complex cacosl(long double complex z); + long double complex cacosl(long double complex z); +

    Description

    The cacos functions compute the complex arc cosine of z, with branch cuts outside the @@ -9750,7 +10094,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex casin(double complex z); float complex casinf(float complex z); - long double complex casinl(long double complex z); + long double complex casinl(long double complex z); +

    Description

    The casin functions compute the complex arc sine of z, with branch cuts outside the @@ -9770,7 +10115,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex catan(double complex z); float complex catanf(float complex z); - long double complex catanl(long double complex z); + long double complex catanl(long double complex z); +

    Description

    The catan functions compute the complex arc tangent of z, with branch cuts outside the @@ -9788,7 +10134,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex ccos(double complex z); float complex ccosf(float complex z); - long double complex ccosl(long double complex z); + long double complex ccosl(long double complex z); +

    Description

    The ccos functions compute the complex cosine of z. @@ -9803,7 +10150,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex csin(double complex z); float complex csinf(float complex z); - long double complex csinl(long double complex z); + long double complex csinl(long double complex z); +

    Description

    The csin functions compute the complex sine of z. @@ -9819,7 +10167,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex ctan(double complex z); float complex ctanf(float complex z); - long double complex ctanl(long double complex z); + long double complex ctanl(long double complex z); +

    Description

    The ctan functions compute the complex tangent of z. @@ -9836,7 +10185,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex cacosh(double complex z); float complex cacoshf(float complex z); - long double complex cacoshl(long double complex z); + long double complex cacoshl(long double complex z); +

    Description

    The cacosh functions compute the complex arc hyperbolic cosine of z, with a branch @@ -9855,7 +10205,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex casinh(double complex z); float complex casinhf(float complex z); - long double complex casinhl(long double complex z); + long double complex casinhl(long double complex z); +

    Description

    The casinh functions compute the complex arc hyperbolic sine of z, with branch cuts @@ -9873,7 +10224,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex catanh(double complex z); float complex catanhf(float complex z); - long double complex catanhl(long double complex z); + long double complex catanhl(long double complex z); +

    Description

    The catanh functions compute the complex arc hyperbolic tangent of z, with branch @@ -9891,7 +10243,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex ccosh(double complex z); float complex ccoshf(float complex z); - long double complex ccoshl(long double complex z); + long double complex ccoshl(long double complex z); +

    Description

    The ccosh functions compute the complex hyperbolic cosine of z. @@ -9907,7 +10260,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex csinh(double complex z); float complex csinhf(float complex z); - long double complex csinhl(long double complex z); + long double complex csinhl(long double complex z); +

    Description

    The csinh functions compute the complex hyperbolic sine of z. @@ -9922,7 +10276,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex ctanh(double complex z); float complex ctanhf(float complex z); - long double complex ctanhl(long double complex z); + long double complex ctanhl(long double complex z); +

    Description

    The ctanh functions compute the complex hyperbolic tangent of z. @@ -9939,7 +10294,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex cexp(double complex z); float complex cexpf(float complex z); - long double complex cexpl(long double complex z); + long double complex cexpl(long double complex z); +

    Description

    The cexp functions compute the complex base-e exponential of z. @@ -9955,7 +10311,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex clog(double complex z); float complex clogf(float complex z); - long double complex clogl(long double complex z); + long double complex clogl(long double complex z); +

    Description

    The clog functions compute the complex natural (base-e) logarithm of z, with a branch @@ -9975,7 +10332,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double cabs(double complex z); float cabsf(float complex z); - long double cabsl(long double complex z); + long double cabsl(long double complex z); +

    Description

    The cabs functions compute the complex absolute value (also called norm, modulus, or @@ -9993,7 +10351,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. double complex cpow(double complex x, double complex y); float complex cpowf(float complex x, float complex y); long double complex cpowl(long double complex x, - long double complex y); + long double complex y); +

    Description

    The cpow functions compute the complex power function xy , with a branch cut for the @@ -10009,7 +10368,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex csqrt(double complex z); float complex csqrtf(float complex z); - long double complex csqrtl(long double complex z); + long double complex csqrtl(long double complex z); +

    Description

    The csqrt functions compute the complex square root of z, with a branch cut along the @@ -10028,7 +10388,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double carg(double complex z); float cargf(float complex z); - long double cargl(long double complex z); + long double cargl(long double complex z); +

    Description

    The carg functions compute the argument (also called phase angle) of z, with a branch @@ -10045,7 +10406,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double cimag(double complex z); float cimagf(float complex z); - long double cimagl(long double complex z); + long double cimagl(long double complex z); +

    Description

    The cimag functions compute the imaginary part of z.196) @@ -10064,7 +10426,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex CMPLX(double x, double y); float complex CMPLXF(float x, float y); - long double complex CMPLXL(long double x, long double y); + long double complex CMPLXL(long double x, long double y); +

    Description

    The CMPLX macros expand to an expression of the specified complex type, with the real @@ -10085,7 +10448,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #define CMPLXF(x, y) ((float complex)((float)(x) + \ _Imaginary_I * (float)(y))) #define CMPLXL(x, y) ((long double complex)((long double)(x) + \ - _Imaginary_I * (long double)(y))) + _Imaginary_I * (long double)(y))) + @@ -10099,7 +10463,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex conj(double complex z); float complex conjf(float complex z); - long double complex conjl(long double complex z); + long double complex conjl(long double complex z); +

    Description

    The conj functions compute the complex conjugate of z, by reversing the sign of its @@ -10115,7 +10480,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double complex cproj(double complex z); float complex cprojf(float complex z); - long double complex cprojl(long double complex z); + long double complex cprojl(long double complex z); +

    Description

    The cproj functions compute a projection of z onto the Riemann sphere: z projects to @@ -10123,7 +10489,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. project to positive infinity on the real axis. If z has an infinite part, then cproj(z) is equivalent to

    -         INFINITY + I * copysign(0.0, cimag(z))
    + INFINITY + I * copysign(0.0, cimag(z)) +
    Returns

    The cproj functions return the value of the projection onto the Riemann sphere. @@ -10135,7 +10502,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. #include <complex.h> double creal(double complex z); float crealf(float complex z); - long double creall(long double complex z); + long double creall(long double complex z); +

    Description

    The creal functions compute the real part of z.197) @@ -10187,7 +10555,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               #include <ctype.h>
    -          int isalnum(int c);
    + int isalnum(int c); +
    Description

    The isalnum function tests for any character for which isalpha or isdigit is true. @@ -10197,7 +10566,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               #include <ctype.h>
    -          int isalpha(int c);
    + int isalpha(int c); +
    Description

    The isalpha function tests for any character for which isupper or islower is true, @@ -10219,7 +10589,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int isblank(int c);
    + int isblank(int c); +
    Description

    The isblank function tests for any character that is a standard blank character or is one @@ -10233,7 +10604,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int iscntrl(int c);
    + int iscntrl(int c); +
    Description

    The iscntrl function tests for any control character. @@ -10243,7 +10615,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int isdigit(int c);
    + int isdigit(int c); +
    Description

    The isdigit function tests for any decimal-digit character (as defined in 5.2.1). @@ -10253,7 +10626,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int isgraph(int c);
    + int isgraph(int c); + @@ -10268,7 +10642,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int islower(int c);
    + int islower(int c); +
    Description

    The islower function tests for any character that is a lowercase letter or is one of a @@ -10281,7 +10656,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int isprint(int c);
    + int isprint(int c); +
    Description

    The isprint function tests for any printing character including space (' '). @@ -10291,7 +10667,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int ispunct(int c);
    + int ispunct(int c); +
    Description

    The ispunct function tests for any printing character that is one of a locale-specific set @@ -10304,7 +10681,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int isspace(int c);
    + int isspace(int c); +
    Description

    The isspace function tests for any character that is a standard white-space character or @@ -10319,7 +10697,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

             #include <ctype.h>
    -        int isupper(int c);
    + int isupper(int c); +
    Description

    The isupper function tests for any character that is an uppercase letter or is one of a @@ -10332,7 +10711,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

             #include <ctype.h>
    -        int isxdigit(int c);
    + int isxdigit(int c); +
    Description

    The isxdigit function tests for any hexadecimal-digit character (as defined in 6.4.4.1). @@ -10344,7 +10724,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

             #include <ctype.h>
    -        int tolower(int c);
    + int tolower(int c); +
    Description

    The tolower function converts an uppercase letter to a corresponding lowercase letter. @@ -10361,7 +10742,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

              #include <ctype.h>
    -         int toupper(int c);
    + int toupper(int c); +
    Description

    The toupper function converts a lowercase letter to a corresponding uppercase letter. @@ -10382,11 +10764,13 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

               EDOM
               EILSEQ
    -          ERANGE
    + ERANGE + which expand to integer constant expressions with type int, distinct positive values, and which are suitable for use in #if preprocessing directives; and
    -          errno
    + errno + which expands to a modifiable lvalue201) that has type int and thread local storage duration, the value of which is set to a positive error number by several library functions. If a macro definition is suppressed in order to access an actual object, or a program @@ -10447,12 +10831,14 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    The type

    -         fenv_t
    + fenv_t + represents the entire floating-point environment.

    The type

    -         fexcept_t
    + fexcept_t + represents the floating-point status flags collectively, including any status the implementation associates with the flags. @@ -10465,7 +10851,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. FE_INEXACT FE_INVALID FE_OVERFLOW - FE_UNDERFLOW + FE_UNDERFLOW + is defined if and only if the implementation supports the floating-point exception by means of the functions in 7.6.2.207) Additional implementation-defined floating-point exceptions, with macro definitions beginning with FE_ and an uppercase letter, may also @@ -10476,7 +10863,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    The macro

    -          FE_ALL_EXCEPT
    + FE_ALL_EXCEPT + is simply the bitwise OR of all floating-point exception macros defined by the implementation. If no such macros are defined, FE_ALL_EXCEPT shall be defined as 0.

    @@ -10485,7 +10873,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''. FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO - FE_UPWARD + FE_UPWARD + is defined if and only if the implementation supports getting and setting the represented rounding direction by means of the fegetround and fesetround functions. Additional implementation-defined rounding directions, with macro definitions beginning @@ -10499,7 +10888,8 @@ margin: deleted text is marked with ''*'', new or changed text with '' ''.

    -          FE_DFL_ENV
    + FE_DFL_ENV + represents the default floating-point environment -- the one installed at program startup