[Boost-bugs] [Boost C++ Libraries] #9536: narrow-conversion uses insufficient input char type

Subject: [Boost-bugs] [Boost C++ Libraries] #9536: narrow-conversion uses insufficient input char type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-30 17:20:39


#9536: narrow-conversion uses insufficient input char type
------------------------------+------------------------
 Reporter: dani@… | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
------------------------------+------------------------
 Test runs exhibit this problem:

 {{{
 compile-c-c++
 ..\..\..\bin.v2\libs\date_time\test\teststreams.test\msvc-12.0\debug
 \address-model-64\posix_time\teststreams.obj
 teststreams.cpp
 boost/date_time/posix_time/posix_time_legacy_io.hpp(83) : warning C4244:
 'argument' : conversion from 'wchar_t' to 'char', possible loss of data
         posix_time\teststreams.cpp(144) : see reference to function
 template instantiation
 'std::basic_istream<wchar_t,std::char_traits<wchar_t>>
 &boost::posix_time::operator
>><wchar_t>(std::basic_istream<wchar_t,std::char_traits<wchar_t>>
 &,boost::posix_time::time_duration &)' being compiled
 }}}

 The current implementation uses std::stringstream::narrow(char) with its
 'char' input parameter type to transform 'charT' chars taken from a
 std::basic_istream<charT> into 'char' chars. This is most likely not what
 is intended if 'charT' is wider than 'char'.

 Tests were run against Boost version 1.55.0 and latest 'development'
 branch using vc10, vc11, and vc12. Test logs are attached.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9536>
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:15 UTC