Boost logo

Boost Users :

Subject: Re: [Boost-users] [Format] boost 1.48.0, vs2010 runtime check triggered by cast to smaller type in feed_args.hpp
From: Bogdan Slusarczyk (bogdan.slusarczyk_at_[hidden])
Date: 2011-11-25 10:31:01


On 2011-11-23 16:47, david x callaway wrote:
> running the code below triggers a runtime crash due to casting to a smaller type in feed_args.hpp if -RTCc is given. we turn on this runtime check for debug builds as shown in the sample code. so far the only remedy I've found is to turn off runtime checks for the entire module, not a nice solution. microsoft's suggestion, to use a pragma to turn off the check, doesn't work (not your problem I know).
>
> the same issue exists in boost 1.47.0.
>
I had the same with 1.38, and as solution I changed this line
(feed_args.hpp):
                 static_cast<size_type>(specs.truncate_ - !!prefix_space),
into
                 static_cast<size_type>( ( specs.truncate_ -
!!prefix_space) & size_type( ~0 ) ),

Regards,
Bogdan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net