Submitter: Willem Wakker (NL)
Submission Date: 2013-05-08
Source: WG 14
Reference Document: N1713
Date: April 2014
Subject: Request for interpretation of C11 6.8.5#6
C11, section 6.8.5 paragraph 6 reads:
An iteration statement whose controlling expression is not a constant expression,156) that performs no input/output operations, does not access volatile objects, and performs no synchronization or atomic operations in its body, controlling expression, or (in the case of a for statement) its expression-3, may be assumed by the implementation to terminate.157)
Question: to what does the that refers back to: to the controlling expression or to the constant expression?
This is indeed an ambiguity, and after considering various proposals, the following was approved.
Apr 2014 meeting
The committee noted a typo in the Suggested Technical Corrigendum where "its expression *157" was intended to be "its expression-3 *157", and so has been corrected below.
Proposed Technical CorrigendumReplace 6.8.5 paragraph 6 with:
An iteration statement may be assumed by the implementation to terminate if its controlling expression is not a constant expression *156), and none of the following operations are performed in its body, controlling expression or (in the case of a for statement) its expression-3 *157):
- input/output operations
- accessing a volatile object
- synchronization or atomic operations.
Previous Defect Report < - > Next Defect Report