Subject: [Boost-bugs] [Boost C++ Libraries] #7949: Level 4 Warnings with VS2005
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-29 12:46:15
#7949: Level 4 Warnings with VS2005
---------------------------------------------------------+------------------
Reporter: Peter Brockamp <p.brockamp@â¦> | Owner: apolukhin
Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
Version: Boost 1.52.0 | Severity: Optimization
Keywords: warnings VS2005 |
---------------------------------------------------------+------------------
Try to compile the following with /W4 under VS2005:
{{{
#include "boost/lexical_cast.hpp"
#include "boost/date_time.hpp"
}}}
This will give you a bunch of warnings:
{{{
\boost\lexical_cast.hpp(732) : warning C4244: '+=' : conversion from 'int'
to 'unsigned short', possible loss of data
\boost\lexical_cast.hpp(1627) : see reference to function template
instantiation 'bool boost::detail::lcast_ret_unsigned<Traits,Type,CharT>(T
&,const CharT *const ,const CharT *)' being compiled
\boost\lexical_cast.hpp(1751) : see reference to function template
instantiation 'bool
boost::detail::lexical_stream_limited_src<CharT,Traits,RequiresStringbuffer>::shr_unsigned<unsigned
short>(Type &)' being compiled
\boost\lexical_cast.hpp(1751) : while compiling class template member
function 'bool
boost::detail::lexical_stream_limited_src<CharT,Traits,RequiresStringbuffer>::operator
>>(unsigned short &)'
\boost\lexical_cast.hpp(2137) : see reference to class template
instantiation
'boost::detail::lexical_stream_limited_src<CharT,Traits,RequiresStringbuffer>'
being compiled
\boost\lexical_cast.hpp(2083) : while compiling class template member
function 'unsigned short
boost::detail::lexical_cast_do_cast<Target,Source>::lexical_cast_impl(const
Source &)'
\boost\lexical_cast.hpp(2300) : see reference to class template
instantiation 'boost::detail::lexical_cast_do_cast<Target,Source>' being
compiled
\boost\date_time\date_parsing.hpp(138) : see reference to function
template instantiation 'Target boost::lexical_cast<unsigned
short,Type>(const Source &)' being compiled
\boost\date_time\gregorian\parsers.hpp(30) : see reference to function
template instantiation 'date_type
boost::date_time::parse_date<boost::gregorian::date>(const std::string
&,int)' being compiled
\boost\lexical_cast.hpp(780) : warning C4244: '+=' : conversion from 'int'
to 'unsigned short', possible loss of data
}}}
Attached a patch which silences these, as is done in other libraries.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7949> 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:11 UTC