Public Comment Number PC-UK0168 ISO/IEC CD 9899 (SC22N2620) Public Comment =========================================== Date: 1998-03-27 Author: Clive D.W. Feather Author Affiliation: Self Postal Address: Demon Internet Limited 322 Regents Park Road London N3 2QQ United Kingdom E-mail Address: Telephone Number: +44 181 371 1138 Fax Number: +44 181 371 1037 Number of individual comments: 1 Comment 1. Category: Inconsistency Committee Draft subsection: 6.5.7 Title: Clarify when VLA sizes are determined NOTICE - this is a replacement for PC-UK0043, which is withdrawn. Detailed description: 6.5.7p3 reads in part: Any array size expression associated with variable length array declarators shall be evaluated with the typedef name at the beginning of its scope upon each normal entry to the block. This wording appears to say that VLA typedefs are evaluated when the block containing them is entered, even though this is not the case for any other kind of declaration (including VLAs themselves). For example: { int n; n = 5; int v1 [n]; n += 2; typedef int vec [n]; n += 2; vec v2; /* ... */ } The above wording would imply that vec, and so v2, contains either 5 or an undefined number of elements, rather than 7 that the average programmer would expect. It is also worthwhile clarifying the effects of a jump to a point between the declaration and use of vec. Change the wording to: Any array size expression associated with variable length array declarators shall be evaluated with the typedef name at the beginning of its scope, and the resulting size shall be used whenever the typedef name is subsequently used. If the scope of the typedef name is entered by a jump rather than the normal sequence of execution, the associated size is unspecified. If a typedef name is used in any way while the associated size is unspecified, the behavior is undefined.