[Boost-bugs] [Boost C++ Libraries] #6635: Boost.Locale UTF encode function passes wrong type to output iterator

Subject: [Boost-bugs] [Boost C++ Libraries] #6635: Boost.Locale UTF encode function passes wrong type to output iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-29 05:37:04


#6635: Boost.Locale UTF encode function passes wrong type to output iterator
-------------------------------------+--------------------------------------
 Reporter: jason.erb@… | Owner: artyom
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: locale
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: Boost.Locale encode UTF |
-------------------------------------+--------------------------------------
 When passing a char output iterator (such as
 {{{std::back_insert_iterator<std::string>}}}) to
 {{{boost::locale::utf::utf_traits<char>::encode}}}, the compiler (Apple
 LLVM compiler 3.1 in Xcode 4.3 with extra warnings enabled) emits a
 warning about assigning {{{unsigned int}}} to {{{char}}}. The code
 incorrectly attempts to write the code unit to the output as a
 {{{code_point}}} instead of a {{{CharType}}}.

 The attached patch performs a safe static cast of each code unit to
 {{{CharType}}} as it is written to the output iterator.

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