Submitter: Willem Wakker (NL)
Submission Date: 2013-05-08
Source: WG 14
Reference Document:
N1713
Version: 1.0
Date: October 2013
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?
Committee Discussion
This is indeed an ambiguity, and after considering various proposals, the following was approved.
Proposed Technical Corrigendum
Replace 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 *157):
- input/output operations
- accessing a volatile object
- synchronization or atomic operations.