[Boost-bugs] [Boost C++ Libraries] #8991: A few implicit conversion compiler warnings

Subject: [Boost-bugs] [Boost C++ Libraries] #8991: A few implicit conversion compiler warnings
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-13 04:24:15


#8991: A few implicit conversion compiler warnings
------------------------------------+--------------------------
 Reporter: Jan Bouwer <JBouwer@…> | Owner: apolukhin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
  Version: Boost 1.54.0 | Severity: Optimization
 Keywords: |
------------------------------------+--------------------------
 The following (trivial?) warnings were kindly highlighted by clang
 ^([#version version])^ - using diagnostic options as indicated in the
 [...].

 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.

 * boost/lexical_cast.hpp:1693:50
         **warning: implicit conversion changes signedness**: 'long' to
 'size_t' (aka 'unsigned long') [-Wsign-conversion]
         {{{
                 end = begin + swprintf(begin, end-begin,
                               ~~~~~~~~ ~~~^~~~~~
 }}}

 * boost/lexical_cast.hpp:1703:50
         **warning: implicit conversion changes signedness**: 'long' to
 'size_t' (aka 'unsigned long') [-Wsign-conversion]
         {{{
                 end = begin + swprintf(begin, end-begin,
                               ~~~~~~~~ ~~~^~~~~~
 }}}

 * boost/lexical_cast.hpp:1711:50
         **warning: implicit conversion changes signedness**: 'long' to
 'size_t' (aka 'unsigned long') [-Wsign-conversion]
         {{{
                 end = begin + swprintf(begin, end-begin,
                               ~~~~~~~~ ~~~^~~~~~
 }}}

 * boost/lexical_cast.hpp:791:68
         **warning: operand of ? changes signedness**: 'int' to 'unsigned
 int' & 'long' to 'unsigned long' [-Wsign-conversion]
         {{{
                 value < 0 ? 0u - static_cast<result_type>(value) : value
                                                                    ^~~~~
 }}}
         from:
         {{{
 boost/lexical_cast.hpp:1627:52: note: in instantiation of function
 template specialization 'boost::detail::lcast_to_unsigned<int>' requested
 here
                 start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n),
 finish);
                                                    ^
 boost/lexical_cast.hpp:1816:66: note: in instantiation of function
 template specialization 'boost::detail::lexical_stream_limited_src<char,
 std::__1::char_traits<char>, false>::shl_signed<int>' requested here
             bool operator<<(int n) { return
 shl_signed(n); }
                                                                  ^
 }}}
         and
         {{{
 boost/lexical_cast.hpp:1627:52: note: in instantiation of function
 template specialization 'boost::detail::lcast_to_unsigned<long>' requested
 here
                 start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n),
 finish);
                                                    ^
 boost/lexical_cast.hpp:1817:66: note: in instantiation of function
 template specialization 'boost::detail::lexical_stream_limited_src<char,
 std::__1::char_traits<char>, false>::shl_signed<long>' requested here
             bool operator<<(long n) { return
 shl_signed(n); }
 }}}

 * boost/lexical_cast.hpp:1962:30
         **warning: implicit conversion changes signedness**: 'utype' (aka
 'unsigned int') to 'int' [-Wsign-conversion]
         {{{
                     output = out_tmp;
                            ~ ^~~~~~~
 }}}
         {{{
 boost/lexical_cast.hpp:2032:74: note: in instantiation of function
 template specialization 'boost::detail::lexical_stream_limited_src<char,
 std::__1::char_traits<char>, false>::shr_signed<int>' requested here
             bool operator>>(int& output) { return
 shr_signed(output); }
                                                                          ^
 }}}


 ==== [=#version "clang --version"]
 {{{
 Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
 Target: x86_64-apple-darwin12.4.0
 Thread model: posix
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8991>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC