Modify

Ticket #11842 (closed Bugs: fixed)

Opened 17 months ago

Last modified 8 days ago

VC 2005 warning "conversion from '__w64 int' to streamsize" when lexical_cast from string to double.

Reported by: l_ting@… Owned by: apolukhin
Milestone: Boost 1.64.0 Component: lexical_cast
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description

Symptom: When cast to double as follows:

double d = boost::lexical_cast<double>("123.4");;

boost 1.59.0 has the following warning when compile on Visual studio 2005 platform under Unicode.

1>c:\boost-v1.59.0\include\boost-1_59\boost\lexical_cast\detail\converter_lexical_streams.hpp(587) : warning C4244: 'argument' : conversion from 'w64 int' to 'boost::detail::basic_pointerbuf<charT,BufferT>::streamsize', possible loss of data

Fix: Change line 586@ boost\lexical_cast\detail\converter_lexical_streams.hpp

From: buf.setbuf(const_cast<CharT*>(start), finish - start); To: buf.setbuf(const_cast<CharT*>(start), static_cast<std::streamsize>(finish - start));

Please review. Thanks

Ting

Attachments

Change History

comment:1 Changed 3 months ago by apolukhin

  • Status changed from new to assigned
  • Milestone changed from To Be Determined to Boost 1.64.0

Fixed in d53933cd develop branch. Will be merged to master as soon as all the tests will cycle.

comment:2 Changed 8 days ago by apolukhin

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

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.