Boost C++ Libraries: Ticket #10520: Conversion warning in intrusive/detail/utilities.hpp https://svn.boost.org/trac10/ticket/10520 <p> Hello, </p> <p> When I compile the following simple code test.cpp </p> <pre class="wiki">#include &lt;boost/intrusive/detail/utilities.hpp&gt; int main() { return 0; } </pre><p> with g++ version 4.8.1, Boost 1.56, and the compilation line </p> <pre class="wiki">g++ -I/home/mbradle/boost -Wconversion test.cpp </pre><p> I get the warning </p> <pre class="wiki">In file included from test.cpp:1:0: /home/mbradle/boost/boost/intrusive/detail/utilities.hpp: In function ‘float boost::intrusive::detail::fast_log2(float)’: /home/mbradle/boost/boost/intrusive/detail/utilities.hpp:592:18: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion] return (val + log_2); ^ </pre><p> Casting log_2 as a float removes the warning, but, given that I do not get this warning if I compile against Boost 1.55 and that I see no difference between the fast_log2 routines in the two versions, I suspect that casting is not the correct fix. Thanks, and best wishes. </p> <p> Brad Meyer </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10520 Trac 1.4.3 Ion Gaztañaga Tue, 30 Sep 2014 19:50:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10520#comment:1 https://svn.boost.org/trac10/ticket/10520#comment:1 <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">fixed</span> </li> </ul> <p> Thanks for the report, casting in the correct answer, maybe in Boost 1.55 this function was not being instantiated. Fixed in: </p> <p> [develop fac6a8e] Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10520" title="#10520: Bugs: Conversion warning in intrusive/detail/utilities.hpp (closed: fixed)">#10520</a> in Boost Trac </p> Ticket