Subject: [Boost-bugs] [Boost C++ Libraries] #2816: microsec_clock::create_time(TZ_FOR_CREATE tz) causes 64-to-32 bit warning on 64 bit targets
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-02 22:04:53
#2816: microsec_clock::create_time(TZ_FOR_CREATE tz) causes 64-to-32 bit warning
on 64 bit targets
-----------------------------+----------------------------------------------
Reporter: pelee_at_[hidden] | Owner:
Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: None
Version: Boost 1.36.0 | Severity: Problem
Keywords: |
-----------------------------+----------------------------------------------
resolution_traits_type::res_adjust() returns a 64 bit integer when boost
is built for a 64 bit target. This leads to a warning about possible
truncation when compiling the version of microsec_clock::create_time()
that takes a single TZ_FOR_CREATE parameter with -Wshorten-64-to-32 on GCC
4.0.1 for MacOSX. The other version of microsec_clock::create_time()
already contains a static_cast to int that prevents this warning. The cast
should be used in both methods:
{{{
int adjust =
static_cast<int>(resolution_traits_type::res_adjust()/1000000);
}}}
This appears to be fixed in revision @49705 on the release branch (along
with a good deal of additional restructuring).
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2816> 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:49:59 UTC