<div dir="ltr">On 5 April 2013 19:40, Joshua Cranmer 🐧 <span dir="ltr"><<a href="mailto:Pidgeot18@gmail.com" target="_blank">Pidgeot18@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)">Per C and C++, integer division by 0 is undefined. That means, if it happens, the compiler is free to do whatever it wants. It is perfectly legal for LLVM to define r to be, say, 42 in this code; it is not required to preserve the fact that the idiv instruction on x86 and x86-64 will trap.</span></div>
</blockquote><div></div></div><br></div><div class="gmail_extra" style>Undefined behaviour aside, would be good to have a warning, I think. Does the static analyser have something like it?</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>cheers,</div><div class="gmail_extra" style>--renato</div></div>