Boost C++ Libraries: Ticket #4904: Comparison between signed and unsigned integer expressions https://svn.boost.org/trac10/ticket/4904 <p> Compiling with g++ 4.4, I get the following warning: </p> <p> /boost/mpl/print.hpp:55: warning: comparison between signed and unsigned integer expressions </p> <p> the expression is </p> <blockquote> <p> sizeof(T) &gt; -1 </p> </blockquote> <p> Is there a specific reason for not using </p> <blockquote> <p> sizeof(T) &gt;= 0 </p> </blockquote> <p> instead? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4904 Trac 1.4.3 anonymous Mon, 29 Nov 2010 14:34:39 GMT <link>https://svn.boost.org/trac10/ticket/4904#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4904#comment:1</guid> <description> <p> I think that making this change would merely replace one warning for another. In particular, it would say "result of expression is always true" or something like that; since for any T sizeof (T) is &gt;= 0 (or, if T is incomplete, is a compile error). </p> <p> A better question is "What is this code trying to accomplish"? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 29 Nov 2010 18:06:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4904#comment:2 https://svn.boost.org/trac10/ticket/4904#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> This code is trying to cause a warning, so it's doing exactly what it's supposed to. Look at the template instantiation backtrace to figure out why. </p> Ticket anonymous Thu, 27 Nov 2014 07:37:56 GMT <link>https://svn.boost.org/trac10/ticket/4904#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4904#comment:3</guid> <description> <blockquote class="citation"> <p> This code is trying to cause a warning </p> </blockquote> <p> Sabotage? </p> </description> <category>Ticket</category> </item> </channel> </rss>