Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2558: Unnecessary conversion warning in lexical_cast
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-21 06:30:12
#2558: Unnecessary conversion warning in lexical_cast
--------------------------------------------------+-------------------------
Reporter: Yang Zhang <yanghatespam@â¦> | Owner: nasonov
Type: Bugs | Status: reopened
Milestone: Boost 1.53.0 | Component: lexical_cast
Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------------------+-------------------------
Changes (by anonymous):
* status: closed => reopened
* resolution: worksforme =>
* milestone: Boost 1.38.0 => Boost 1.53.0
Comment:
This above code is either broken again or still broken with g++ 4.7.
{{{
$ g++-fsf-4.7 -I/sw/include/ -Wconversion Foo.cpp
In file included from Foo.cpp:1:0:
/sw/include/boost/lexical_cast.hpp: In instantiation of 'CharT*
boost::detail::lcast_put_unsigned(T, CharT*) [with Traits =
std::char_traits<char>; T = unsigned int; CharT = char]':
/sw/include/boost/lexical_cast.hpp:860:13: required from 'bool
boost::detail::lexical_stream_limited_src<CharT, Base,
Traits>::operator<<(int) [with CharT = char; Base =
boost::detail::lexical_streambuf_fake; Traits = std::char_traits<char>]'
/sw/include/boost/lexical_cast.hpp:1151:13: required from 'Target
boost::detail::lexical_cast(typename
boost::call_traits<Source>::param_type, CharT*, std::size_t) [with Target
= std::basic_string<char>; Source = int; bool Unlimited = false; CharT =
char; typename boost::call_traits<Source>::param_type = const int;
std::size_t = long unsigned int]'
/sw/include/boost/lexical_cast.hpp:1174:77: required from 'Target
boost::lexical_cast(const Source&) [with Target = std::basic_string<char>;
Source = int]'
Foo.cpp:6:25: required from here
/sw/include/boost/lexical_cast.hpp:522:72: warning: conversion to 'char'
from 'int' may alter its value [-Wconversion]
/sw/include/boost/lexical_cast.hpp:524:74: warning: conversion to 'char'
from 'int' may alter its value [-Wconversion]
/sw/include/boost/lexical_cast.hpp:548:25: warning: conversion to 'char'
from 'int' may alter its value [-Wconversion]
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2558#comment:2> 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