<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-03-16 1:12 GMT+01:00 Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2015-03-16 0:52 GMT+01:00 Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>2015-03-15 3:36 GMT+01:00 Andres Valloud <span dir="ltr">&lt;<a href="mailto:avalloud@smalltalk.comcastbiz.net" target="_blank">avalloud@smalltalk.comcastbiz.net</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
So how about keeping a copy of C99 handy?  Whenever you suspect a compiler bug, see if you can use it to prove the compiler wrong. Obviously compilers are not flawless, but it really helps to rule out cases of garbage-in, garbage-out.<span><br>
<br></span></blockquote><div><br></div></span><div>Hi Andres<br></div><br><div>For -1LL&lt;&lt;63, it&#39;s more readable for sure, but not more portable, see<br><a href="http://stackoverflow.com/questions/3784996/why-does-left-shift-operation-invoke-undefined-behaviour-when-the-left-side-oper" target="_blank">http://stackoverflow.com/questions/3784996/why-does-left-shift-operation-invoke-undefined-behaviour-when-the-left-side-oper</a><br><br></div></div></div></div></blockquote><div><br></div></span><div>Oops, I missread this one too... <br>-1LL&lt;&lt;63 seems correct.<br></div></div></div></div></blockquote><div><br></div><div>Ah no, it&#39;s UB, time to go to get some rest...<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>For reading the C standard, I often take a shorter path: the question must have been raised on SO ;)<br></div><div>This time I consulted gcc bug reports, and several were including this constant, thus my incorrect analysis at first.<br></div><div>But for sure, the chances of discovering a bug is really tiny compared to the chances of miss-interpreting the standard!<span><font color="#888888"><br></font></span></div><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div>Nicolas<br></div></font></span><span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
On 3/13/15 16:47 , Nicolas Cellier wrote:<br>
</span><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Ah, ah, it&#39;s not a gcc bug, it&#39;s just one another C pitfall...<br>
</blockquote>
</div></div></blockquote></span></div><br></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>