Submitter:Fred J. Tydeman
Submission Date: 2021-04-18
Document: WG14 N2713
Title: N2713: Integer Constant Expression
Reference Documents: C99 DR 312, C11 DR 489, N2596

Summary

Based upon my testing, implementations differ on their treatment of what is or is not an integer constant expression, and hence, what is or is not a VLA (variable length array).

Defect Report (DR) 312 against C99 has, as part of the committee discussion:

Even if an implementation accepts other forms of constant expressions, paragraph 6.6#10 does not change the definition of an integer constant expression given by paragraph 6.6#6, and int[(int)+1.0] is still a VLA.

However, those words have never been added to C.

Proposal

Change 6.6 Constant expressions, paragraph 10:

An implementation may accept other forms of constant expressions.

to

An implementation may accept other forms of constant expressions, however, they are not an integer constant expression.