Boost C++ Libraries: Ticket #1095: GCC warnings with -Wsign-promo https://svn.boost.org/trac10/ticket/1095 <p> The mere inclusion of &lt;boost/functional/hash.hpp&gt; produces warnings in GCC for Boost 1.34 when -Wsign-promo is set: </p> <p> In file included from /.../boost/functional/hash.hpp:10, </p> <blockquote> <p> from ... </p> </blockquote> <p> /.../boost/functional/hash/hash.hpp: In member function </p> <blockquote> <p> `size_t boost::hash&lt;bool&gt;::operator()(bool) const': </p> </blockquote> <p> /.../boost/functional/hash/hash.hpp:353: warning: passing </p> <blockquote> <p> <code>bool' chooses </code>int' over `long unsigned int' </p> </blockquote> <p> [...] </p> <p> In Boost 1.33.1, the warnings only appear when hash&lt;bool&gt;, hash&lt;ungisned char&gt;, hash&lt;wchar_t&gt; or hash&lt;short unsigned int&gt; are instantiated --the difference between that 1.33.1 and 1.34 is that the latter automatically instantiates a number of specialization for integral types, among them the offending ones. </p> <p> Although the warnings seem unharmful, it'd be great if they can be silenced by providing overloads of hash_value for all C++ integral types, so that no integral promotions occur. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1095 Trac 1.4.3 Daniel James Fri, 10 Aug 2007 10:30:52 GMT status, milestone changed https://svn.boost.org/trac10/ticket/1095#comment:1 https://svn.boost.org/trac10/ticket/1095#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.35.0</span> </li> </ul> Ticket Daniel James Fri, 24 Aug 2007 02:06:07 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1095#comment:2 https://svn.boost.org/trac10/ticket/1095#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/38881" title="Add extra overloads for hash_value to cover all the specializations of ...">[38881]</a>. </p> Ticket