<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">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 class="im"><br>
<br></span></blockquote><div><br></div><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">http://stackoverflow.com/questions/3784996/why-does-left-shift-operation-invoke-undefined-behaviour-when-the-left-side-oper</a><br><br><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!<br></div><br></div><div>Nicolas<br></div><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 class="im">
On 3/13/15 16:47 , Nicolas Cellier wrote:<br>
</span><div class=""><div class="h5"><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></div><br></div></div>