[ub] A proposal to define signed overflow submitted?
Hyman Rosen
hyman.rosen at gmail.com
Thu Mar 15 06:24:06 CET 2018
On Wed, Mar 14, 2018 at 6:50 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:
>
> Infinite loops are undefined behavior because you'd have to solve the
> halting problem in order to determine whether any given code path is
> dynamically reachable. So presence of an infinite loop is UB in order
> to allow optimizers to generate code assuming the behavior never
> occurs.
As soon as you mention the word "optimizer" you are lost.
Compilers don't need to solve anything. All they need to do is to model the
abstract machine on the underlying computer. If the abstract machine
executes
an infinite loop, so does the computer. As the programmer wrote it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/ub/attachments/20180315/5fb5bc0c/attachment.html
More information about the ub
mailing list