Subject: [Boost-bugs] [Boost C++ Libraries] #4636: Run-Time Check Failure #1 in feed_args.hpp using Visual Studio 2010
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-09-08 07:12:26
#4636: Run-Time Check Failure #1 in feed_args.hpp using Visual Studio 2010
------------------------------------------------------+---------------------
Reporter: Rüdiger Brünner <rbruenner@â¦> | Owner: samuel_krempp
Type: Bugs | Status: new
Milestone: To Be Determined | Component: format
Version: Boost 1.43.0 | Severity: Problem
Keywords: format Run-Time Check Failure VS2010 |
------------------------------------------------------+---------------------
Hello,
the statement
size_type res_size = (std::min)(
static_cast<size_type>(specs.truncate_ - !!prefix_space),
buf.pcount() );
on line 166 ff. causes an error message in Debug mode in VS 2010 when run-
time checks are enabled:
"Run-Time Check Failure #1 - A cast to a smaller data type has caused a
loss of data. If this was intentional, you should mask the source of the
cast with the appropriate bitmask. For example:
char c = (i & 0xFF);
Changing the code in this way will not affect the quality of the resulting
optimized code."
The value of specs.truncate_ (64 bits) is LLONG_MAX that is going to be
cast down to a size_t (32 bits). This causes that warning.
Would it be feasible to initalise the truncate_ member to INT_MAX on 32
bit systems to avoid this issue?
This message is *very* annoying since it pops up very frequently.
Best regards
Rüdiger
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4636> 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:04 UTC