Title: Technical corrigendum for C1X
Document: N1359
Date: 2009/02/12
Author: Benito


This document covers the proposed technical corrigendum text from the following defect report 345, 344, 343, 341, 340, 338, 336, 330, 329, 328, 327, 326, and 315.

This document does not cover defect reports

The following 13 defects have proposed technical corrigendum text, but were not swept up into a Technical Corrigendum for the 9899:1999 Standard.

  1. 345

    Change 6.9.1 paragraph 9 to:

    Each parameter has automatic storage duration. Its identifier is an lvalue,*) the layout of the storage for parameters is unspecified.

    *)A parameter identifier cannot be redeclared in the function body except in an enclosed block.

    Change 6.2.1 paragraph 4 to:

    ... If an identifier designates two different entities in the same name space, the scopes might overlap. If so, the scope of one entity (the inner scope) will end strictly before the scope of the other entity (the outer scope). Within the inner scope, the identifier designates the entity declared in the inner scope; the entity declared in the outer scope is hidden (and not visible) within the inner scope.

  2. 344

    Change 6.10.1p1:

    The expression that controls conditional inclusion shall be an integer constant expression except that: it shall not contain a cast; identifiers (including those lexically identical to keywords) are interpreted as described below;141) and it may contain unary operator expressions of the form
  3. 343

    Change 6.7.8 paragraph 15:

    "wchar_t"
    to
    "a qualified or unqualified version of wchar_t".
  4. 341

    Add a new paragraph to 6.2.1, at the end (following paragraph 7):

    As a special case, a type-name (which is not a declaration of an identifier) is considered to have a scope that begins just after the place within the type-name where the omitted identifier would appear were it not omitted.

    Also add a forward reference to Type names (6.7.6).

    6.7.5.2 paragraph 4, change

    declarations with function prototype scope
    to
    declarations or type-names with function prototype scope
  5. 340

    In sub-clause 6.2.7, paragraph 3, change the first bullet to the following.

    – If both types are array types, the following rules are applied:
    If one type is an array of known constant size, the composite type is an array of that size.
    Otherwise, if one type is a variable length array whose size is specified by an expression that is not evaluated, the behavior is undefined.
    Otherwise, if one type is a variable length array whose size is specified, the composite type is a variable length array of that size.
    Otherwise, if one type is a variable length array of unspecified size, the composite type is a variable length array of unspecified size.
    Otherwise, both types are arrays of unknown size, and the composite type is an array of unknown size.
    The element type of the composite type is the composite type of the two element types.
    In sub-clause J.2, paragraph 1, insert the following bullet in order.
    – A program requires the formation of a composite type from a variable length array type whose size is specified by an expression that is not evaluated (6.2.7).
  6. 338

    In 6.3.2.1 paragraph 2, add a sentence to the end:

    If the lvalue designates an object of automatic storage duration that could have been declared with register storage class (never had its address taken), and that object is uninitialized (not declared with an initializer, and no assignment to it has been performed prior to the use), the behavior is undefined.
  7. 336

    Change 7.19.1 para 3 from:

    the maximum number of unique file names that can be generated by the tmpnam function".

    to

    the minimum number of unique file names that can be generated by the tmpnam function".

    Also, at 7.19.4.4 p2, change

    "The function is potentially capable of generating TMP_MAX different strings, but any or all of them may already be in use by existing files and thus not be suitable return values."

    to

    "The function is potentially capable of generating at least TMP_MAX different strings, but any or all of them may already be in use by existing files and thus not be suitable return values."
  8. 330

    Change 7.12.1 paragraph 1 last sentence to:

    Each function shall execute as if it were a single operation without generating any of the exceptions "invalid", "divide-by-zero", or "overflow" except to reflect the result of the function.
  9. 329

    In section 7.12.10.2, remove the sentence "Thus, the remainder is always exact." in footnote 204.

    In section F.9.3.4 The frexp functions add the following sentence:

    When the radix of the argument is a power of 2, the returned value is exact and is independent of the current rounding direction mode.

    In section F.9.3.5 The ilogb functions, add the following sentence:

    When the returned value is representable in the range of the return type, the returned value is exact and is independent of the current rounding direction mode.

    In section F.9.3.11 The logb functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.3.12 The modf functions, add the following sentence:

    The returned values are exact and are independent of the current rounding direction mode.

    In section F.9.4.2 The fabs functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.4.5 The sqrt functions, add the following sentence:

    The returned value is dependent on the current rounding direction mode.

    In section F.9.6.1 The ceil functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.6.2 The floor functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.6.8 The trunc functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.7.1 The fmod functions, add the following sentence:

    When subnormal results are supported, the returned value is exact and is independent of the current rounding direction mode.

    In section F.9.7.2 The remainder functions, add the following sentence:

    When subnormal results are supported, the returned value is exact and is independent of the current rounding direction mode.

    In section F.9.7.3 The remquo functions, add the following sentence:

    When subnormal results are supported, the returned value is exact and is independent of the current rounding direction mode.

    In section F.9.8.1 The copysign functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.8.2 The nan functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.8.3 The nextafter functions, add the following sentence:

    Even though underflow or overflow can occur, the returned value is independent of the current rounding direction mode.

    In section F.9.8.4 The nexttoward functions, add the following sentence:

    Even though underflow or overflow can occur, the returned value is independent of the current rounding direction mode.

    In section F.9.9.2 The fmax functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.

    In section F.9.9.3 The fmin functions, add the following sentence:

    The returned value is exact and is independent of the current rounding direction mode.
  10. 328

    Replace 6.5.2.5 paragraph 2 and 3 with:

    All the constraints for initializer lists in 6.7.8 are applicable to compound literals.

    Change 6.5.2.5 paragraph 7 to:

    All the semantic rules for initializers lists in 6.7.8 are applicable to compound literals.82)
  11. 327

    Change first sentence of 6.7.5.2p4 (adding italics) from::

    If the size is * instead of being an expression, the array type is a variable length array type of unspecified size, which can only be used in declarations with function prototype scope; such arrays are nonetheless complete types.

    to

    If the size is * instead of being an expression, the array type is a variable length array type of unspecified size, which can only be used in declarations with function prototype scope; such arrays are nonetheless complete types.

    Change the second sentence (adding italics) from:

    If the size is an integer constant expression and the element type has a known constant size, the array type is not a variable length array type; otherwise, the array type is a variable length array type.

    to

    If the size is an integer constant expression and the element type has a known constant size, the array type is not a variable length array type; otherwise, the array type is a variable length array type.

    Change list of Forward references following 6.2.4p6 from

    Forward references: statements (6.8), function calls (6.5.2.2), declarators (6.7.5), array declarators (6.7.5.2), initialization (6.7.8).

        to

    Forward references: statements (6.8), function calls (6.5.2.2), declarators (6.7.5), array declarators (6.7.5.2), variable length array type (6.7.5.2), initialization (6.7.8).

    Add forward reference section following 6.2.7p5:

    Forward references: variable length array type (6.7.5.2).

    Change list of Forward references following 6.5.3.4p7 from:

    Forward references: common definitions <stddef.h> (7.17), declarations (6.7), structure and union specifiers (6.7.2.1), type names (6.7.6), array declarators (6.7.5.2).

        to

    Forward references: common definitions <stddef.h> (7.17), declarations (6.7), structure and union specifiers (6.7.2.1), type names (6.7.6), array declarators (6.7.5.2), variable length array type (6.7.5.2).

    Change list of Forward references following 6.7.2.1p22 from:

    Forward references: tags (6.7.2.3).

        to

    Forward references: tags (6.7.2.3), variably modified type (6.7.5).

  12. 326

    Add after the example code, and before the "Returns" section, the following new paragraph:

    If any of the fields of the tm structure pointed to by timeptr contain values that are outside the normal ranges*), the behavior of asctime() is undefined. If the calculated year exceeds four digits, or is less than the year 1000, the behavior is undefined.
    Add footnote *):
    See 7.23.1 para 4 for the specifications of the "normal ranges".
  13. 315

    Last sentence of paragraph 2 of 6.3.1.1, add the words as restricted by the width, for a bit-field as follows:

    If an int can represent all values of the original type (as restricted by the width, for a bit-field), the type is converted to an int;