id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc
8991,A few implicit conversion compiler warnings,Jan Bouwer ,Antony Polukhin,"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(value) : value
^~~~~
}}}
from:
{{{
boost/lexical_cast.hpp:1627:52: note: in instantiation of function template specialization 'boost::detail::lcast_to_unsigned' requested here
start = lcast_put_unsigned(lcast_to_unsigned(n), finish);
^
boost/lexical_cast.hpp:1816:66: note: in instantiation of function template specialization 'boost::detail::lexical_stream_limited_src, false>::shl_signed' 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' requested here
start = lcast_put_unsigned(lcast_to_unsigned(n), finish);
^
boost/lexical_cast.hpp:1817:66: note: in instantiation of function template specialization 'boost::detail::lexical_stream_limited_src, false>::shl_signed' 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, false>::shr_signed' 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
}}}",Bugs,closed,Boost 1.69,lexical_cast,Boost 1.54.0,Cosmetic,fixed,,