<div class="gmail_quote">On Fri, Apr 8, 2011 at 6:29 PM, Sean McBride <span dir="ltr"><<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all,<br>
<br>
One of the few remaining warnings building VTK with clang is:<br>
<br>
<br>
/VTK/Utilities/vtksqlite/vtk_sqlite3.c:19158:15: warning: shift result<br>
(8321499136) requires 34 bits to represent, but 'int' only has 32 bits [-<br>
Wshift-overflow]<br>
    a &= (0x1f<<28)|(0x7f<<14)|(0x7f);<br>
          ~~~~^ ~~<br>
<br>
The warning seems quite correct.  The code's intent is incomprehensible<br>
however. :)  Anyone an expert in vtksqlite/vtk_sqlite3.c ?<br></blockquote><div><br><br>Not an expert, but I used google to find the canonical source for SQLite. :-)<br><br>The line in the HEAD of the sqlite code appears to look like this:<br>
<br>    a &= SLOT_4_2_0;<br><br>And SLOT_4_2_0 is defined as:<br><br>  #define SLOT_4_2_0   0xf01fc07f<br><br>With a later assertion:<br><br>  assert( SLOT_4_2_0 == ((0xfU<<28) | (0x7f<<14) | (0x7f)) );<br>
<br>Whether we can take a one-line fix and simply apply...<br><br>  (0xfU<<28) | (0x7f<<14) | (0x7f)<br><br>... to eliminate our warning, I do not know. But these are the facts. That code is pretty hard to understand why they're doing what they're doing... it's a bit bit-shifty...<br>
<br>I am comparing to Sqlite HEAD as of right now, from:<br><br>  <a href="http://www.sqlite.org/cgi/src/info/543f75a6ab">http://www.sqlite.org/cgi/src/info/543f75a6ab</a><br><br>The code in question maps to their "src/util.c" file. (Found with a grep for "0x7f<<14" ...)<br>
<br>  :-P<br><br><br>Have a good weekend.<br>David C.<br><br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Cheers,<br>
<br>
--<br>
____________________________________________________________<br>
Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
Rogue Research                        <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
Mac Software Developer              Montréal, Québec, Canada<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br>