Boost C++ Libraries: Ticket #8991: A few implicit conversion compiler warnings https://svn.boost.org/trac10/ticket/8991 <p> The following (trivial?) warnings were kindly highlighted by clang <sup>(<a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8991#version" title="#8991: Bugs: A few implicit conversion compiler warnings (closed: fixed)">version</a>)</sup> - using diagnostic options as indicated in the [...]. </p> <p> File locations are in the format path:line:byte-column. I based these on the 1.54.0 release, as svn rev. 85329 did not compile for me at the time. </p> <ul><li> boost/lexical_cast.hpp:1693:50 </li></ul><blockquote> <p> <strong>warning: implicit conversion changes signedness</strong>: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] </p> <pre class="wiki"> end = begin + swprintf(begin, end-begin, ~~~~~~~~ ~~~^~~~~~ </pre></blockquote> <p> </p> <ul><li> boost/lexical_cast.hpp:1703:50 </li></ul><blockquote> <p> <strong>warning: implicit conversion changes signedness</strong>: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] </p> <pre class="wiki"> end = begin + swprintf(begin, end-begin, ~~~~~~~~ ~~~^~~~~~ </pre></blockquote> <ul><li> boost/lexical_cast.hpp:1711:50 </li></ul><blockquote> <p> <strong>warning: implicit conversion changes signedness</strong>: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] </p> <pre class="wiki"> end = begin + swprintf(begin, end-begin, ~~~~~~~~ ~~~^~~~~~ </pre></blockquote> <ul><li> boost/lexical_cast.hpp:791:68 </li></ul><blockquote> <p> <strong>warning: operand of ? changes signedness</strong>: 'int' to 'unsigned int' &amp; 'long' to 'unsigned long' [-Wsign-conversion] </p> <pre class="wiki"> value &lt; 0 ? 0u - static_cast&lt;result_type&gt;(value) : value ^~~~~ </pre><p> from: </p> <pre class="wiki">boost/lexical_cast.hpp:1627:52: note: in instantiation of function template specialization 'boost::detail::lcast_to_unsigned&lt;int&gt;' requested here start = lcast_put_unsigned&lt;Traits&gt;(lcast_to_unsigned(n), finish); ^ boost/lexical_cast.hpp:1816:66: note: in instantiation of function template specialization 'boost::detail::lexical_stream_limited_src&lt;char, std::__1::char_traits&lt;char&gt;, false&gt;::shl_signed&lt;int&gt;' requested here bool operator&lt;&lt;(int n) { return shl_signed(n); } ^ </pre><p> and </p> <pre class="wiki">boost/lexical_cast.hpp:1627:52: note: in instantiation of function template specialization 'boost::detail::lcast_to_unsigned&lt;long&gt;' requested here start = lcast_put_unsigned&lt;Traits&gt;(lcast_to_unsigned(n), finish); ^ boost/lexical_cast.hpp:1817:66: note: in instantiation of function template specialization 'boost::detail::lexical_stream_limited_src&lt;char, std::__1::char_traits&lt;char&gt;, false&gt;::shl_signed&lt;long&gt;' requested here bool operator&lt;&lt;(long n) { return shl_signed(n); } </pre></blockquote> <ul><li> boost/lexical_cast.hpp:1962:30 </li></ul><blockquote> <p> <strong>warning: implicit conversion changes signedness</strong>: 'utype' (aka 'unsigned int') to 'int' [-Wsign-conversion] </p> <pre class="wiki"> output = out_tmp; ~ ^~~~~~~ </pre><pre class="wiki">boost/lexical_cast.hpp:2032:74: note: in instantiation of function template specialization 'boost::detail::lexical_stream_limited_src&lt;char, std::__1::char_traits&lt;char&gt;, false&gt;::shr_signed&lt;int&gt;' requested here bool operator&gt;&gt;(int&amp; output) { return shr_signed(output); } ^ </pre></blockquote> <h4 class="section" id="clang--version"><span class="wikianchor" id="version">"clang --version"</span></h4> <pre class="wiki">Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.4.0 Thread model: posix </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8991 Trac 1.4.3 Antony Polukhin Mon, 18 Nov 2013 11:06:07 GMT <link>https://svn.boost.org/trac10/ticket/8991#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8991#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86750" title="Fix some of the implicit conversion warnings (refs #8991)">[86750]</a>) Fix some of the implicit conversion warnings (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8991" title="#8991: Bugs: A few implicit conversion compiler warnings (closed: fixed)">#8991</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Tue, 25 Sep 2018 09:00:17 GMT</pubDate> <title>status, severity, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8991#comment:2 https://svn.boost.org/trac10/ticket/8991#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">fixed</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Optimization</span> → <span class="trac-field-new">Cosmetic</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.69</span> </li> </ul> <p> Last portion of fixes merged in <a class="ext-link" href="https://github.com/boostorg/lexical_cast/commit/6cfa994a459150e55f4f2206dcf1745aa16c7ad7"><span class="icon">​</span>6cfa994a</a> </p> Ticket