Opened 5 years ago

Closed 5 years ago

#6645 closed Bugs (fixed)

lexical_cast<float>("0.0") -> warning:

Reported by: ChristianR <habadaschi@…> Owned by: apolukhin
Milestone: Boost 1.50.0 Component: lexical_cast
Version: Boost 1.49.0 Severity: Optimization
Keywords: lexical_cast float warning Cc: antoshkka@…


float f = boost::lexical_cast<float>("0.123");

compiler warning: boost/boost/lexical_cast.hpp:954: warning: implicit conversion shortens 64-bit value into a 32-bit value

32 and 64 bit with i686-apple-darwin10-gcc-4.2.1 (Xcode 3.2.5)

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by ChristianR <habadaschi@…>

boost/lexical_cast.hpp: In function 'bool boost::detail::lcast_ret_float(T&, const CharT*, const CharT*) [with Traits = std::char_traits<char>, T = float, CharT = char]':

boost/lexical_cast.hpp:1637: instantiated from 'bool boost::detail::lexical_stream_limited_src<CharT, Traits, RequiresStringbuffer?>::operator>>(float&) [with CharT = char, Traits = std::char_traits<char>, bool RequiresStringbuffer? = true]'

boost/lexical_cast.hpp:1920: instantiated from 'static Target boost::detail::lexical_cast_do_cast<Target, Source>::lexical_cast_impl(const Source&) [with Target = float, Source = const char*]'

boost/lexical_cast.hpp:2087: instantiated from 'Target boost::lexical_cast(const Source&) [with Target = float, Source = char [6]]'

sandbox.cpp:149: instantiated from here

boost/lexical_cast.hpp:954: warning: implicit conversion shortens 64-bit value into a 32-bit value

comment:2 Changed 5 years ago by apolukhin

  • Cc antoshkka@… added
  • Status changed from new to assigned

Changes were made in trunk at r77221 to suppress this warning.
can you reproduce it now?

comment:3 Changed 5 years ago by anonymous

I don't see it anymore. Thanks.

comment:4 Changed 5 years ago by apolukhin

  • Resolution set to fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain apolukhin.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.