Re:“Pack it in, mathematicians, someone owes LLVM a million ...
by rrss on Thursday August 19, 2021 @10:30AM
(#28234266)
I think C11 and later have similar forward progress requirements as C++11 and later, C just has an additional exception for loops with constant conditions.
[ Parent
| on HN ]
Re:“Pack it in, mathematicians, someone owes LLVM a million ...
by foxfluff on Thursday August 19, 2021 @10:48AM
(#28234520)
N1570 "An iteration statement whose controlling expression is not a constant expression, 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."
Doesn't seem like UB but optimizing effectless loops out is permitted.