On 29 May 2013 14:35, Jens Maurer <span dir="ltr">&lt;<a href="mailto:Jens.Maurer@gmx.net" target="_blank">Jens.Maurer@gmx.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
 (1) Is a compiler diagnostic acceptable?  Yes.<br>
 (2) Is a run-time abort acceptable?  Yes.<br>
 (3) Is an unspecified result value acceptable?  Yes.<br>
 (4) Is it acceptable that your compiler changes the behavior<br>
of unrelated code that follows the overflow?  That&#39;s very surprising.<br>
<br>
Giving compilers latitude to choose among 1-3 (depending on the<br>
target audience) is fine, but, in my opinion, prohibiting option 4<br>
would be an improvement.<br></blockquote><div><br>The counter argument is usually that (4) has a run time cost in that the overflow must now be detected instead of just assumed that it cannot happen.  This effectively penalizes correct programs.<br>

<br>What does &quot;behavior of unrelated code&quot; even mean once we&#39;ve invoked undefined behavior?<br></div></div>-- <br> Nevin &quot;:-)&quot; Liber  &lt;mailto:<a href="mailto:nevin@eviloverlord.com" target="_blank">nevin@eviloverlord.com</a>&gt;  (847) 691-1404