SC22/WG14 N774 J11/97-138 Changes adopted by WG14 Assorted minor substantive issues Clive D.W. Feather clive@demon.net 1997-09-26 Specific items ============== Item 1 [Was N720 item DR 174] ---------------------- In subclause 6.2.1.7 paragraph 1, replace: Many binary operators that expect operands of arithmetic type cause conversions and yield result types in a similar way. The purpose is to yield a /common real type/ for the operands and result. For the operands, each operand is converted, without change of type-domain, to a type whose corresponding real type is the common real type. The common real type is also the corresponding real type of the result, whose type-domain is determined by the operator. with: Many operators that expect operands of arithmetic type cause conversions and yield result types in a similar way. The purpose is to yield a /common real type/ for the operands and result. For the specified operands, each operand is converted, without change of type-domain, to a type whose corresponding real type is the common real type. Unless stated explicitly otherwise, the common real type is also the corresponding real type of the result, whose type-domain is determined by the operator. In subclause 6.3.15, replace paragraphs 4 and 5 with: The first operand is evaluated; there is a sequence point after its evaluation. The second operand is evaluated only if the first compares unequal to 0; the third operand is evaluated only if the first compares equal to 0; the result of the operator is the value of the second or third operand (whichever is evaluated), converted to the type described below. If both the second and third operands have arithmetic type, the type that the usual arithmetic conversions would yield if applied to those two operands is the type of the result. If both the operands have structure or union type, the result has that type. If both operands have void type, the result has void type. and change the last sentence of paragraph 6 to end: ... in which case the type of the result is pointer to void. Item 3 [Was N720 item DR 070] ---------------------- In subclause 6.3.2.3 paragraph 5, after: ... the types of the arguments after promotion are not compatible with those of the parameters after promotion, the behaviour is undefined. insert: except for the following cases: - one promoted type is a signed integer type, the other promoted type is the corresponding unsigned integer type, and the value is representable in both types; - one type is pointer to void and the other is a pointer to a character type. Item 4 [Was N720 item DR 115] ---------------------- Change subclause 6.5 paragraph 2 to: A declaration shall declare at least a declarator (excluding the parameters of a function or the members of a structure or union), a tag, or the members of an enumeration. Item 5 [Was N720 item DR 165] ---------------------- Replace subclause 6.5.2.3 by the following wording (taken from the DR): 6.5.2.3 Tags Constraints A specific type shall have its content defined at most once. A type specifier of the form enum identifier without an enumerator list shall only appear when the type it specifies is complete. Semantics All declarations of structure, union, or enumerated types that have the same scope and use the same tag declare the same type. The type is incomplete [F1] until the closing brace of the list defining the content, and complete thereafter. [F1] An incomplete type may only be used when the size of an object of that type is not needed. [Append the present footnote 99] Two declarations of structure, union, or enumerated types which are in different scopes or use different tags declare distinct types. Each declaration of a structure, union, or enumerated type which does not include a tag declares a distinct type. A type specifier of the form struct-or-union identifier/opt { struct-declaration-list } or enum identifier/opt { 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 [F2], the type specifier also declares the identifier to be the tag of that type. [F2] If there is no identifier, the type can, within the translation unit, only be referred to by the declaration of which it is a part. Of course, when the declaration is of a typedef name, subsequent declarations can make use of that typedef name to declare objects having the specified structure, union, or enumerated type. A declaration of the form struct-or-union identifier ; specifies a structure or union type and declares the identifier as the tag of that type [F3]. [F3] A similar construction with /enum/ does not exist. If a type specifier of the form struct-or-union identifier occurs other than as part of one of the above constructions, and no other declaration of the identifier as a tag is visible, then it declares a structure or union type which is incomplete at this point, and declares the identifer as the tag of that type [F3]. If a type specifier of the form struct-or-union identifier or enum identifier occurs other than as part of one of the above constructions, 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. [Retain the existing examples.] Item 6 [Was N720 item DRs 096 and 110] ------------------------------- In subclause 6.5.5.2 add a further constraint: The element type shall not be an incomplete or function type. Item 7 [Was N720 item DR 084] ---------------------- In subclause 6.5.5.3 add a further constraint: After all rewrites [*], the parameters in a parameter-type-list that is part of a function definition shall not have incomplete type. [*] Arrays and functions are rewritted as pointers. and a new Semantics paragraph after paragraph 6: If the function declarator is not part of a function definition, the parameters may have incomplete type. Item 10 [Was N735 item 5] ----------------- Change the first sentence of subclause 7.1.2 paragraph 1 from: Each library function is declared in a /header/, [135] ... to: Each library function is declared, with a type that includes a prototype, in a /header/, [135] ... Item 13 [Was N720 item DR 066] ---------------------- In subclause 7.5.2.1 paragraph 3, insert after "of zero length": Apart from /grouping/ and /mon_grouping/, the strings shall start and end in the initial shift state. Item 14 [Was N735 item 8] ----------------- In subclause 7.10.1.1 (setjmp()), change the heading "Environmental constraint" to "Environmental restriction" and add at the end: If the invocation appears in any other context, the behaviour is undefined. Item 15 [Was N720 item DR 140] ---------------------- In subclause 7.13.5.6 (setvbuf()) paragraph 2, change: ... any other operation ... to: ... any other operation (other than an unsuccessful call to /setvbuf/) ... Item 17 [Was N720 item DR 134] ---------------------- In subclause 7.15.6.2 (strerror()), change the semantics to: The /strerror/ function maps the number in /errnum/ to a message string. Typically, the values for /errnum/ come from /errno/, but /strerror/ shall map any value of type /int/ to a message.