Subject: [Boost-bugs] [Boost C++ Libraries] #9489: boost::date_time::time_resolution_traits uses 32-bit seconds for 64-bit systems
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-12 19:29:52
#9489: boost::date_time::time_resolution_traits uses 32-bit seconds for 64-bit
systems
------------------------------+------------------------
Reporter: mreissne@⦠| Owner: az_sw_dude
Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
Version: Boost 1.54.0 | Severity: Problem
Keywords: |
------------------------------+------------------------
boost::date_time::time_resolution_traits defaults to boost::int32_t for
its v_type parameter. This means that for 64-bit systems, such as
time_resolution_traits_bi64_impl and
time_resolution_traits_adapted64_impl, date-times whose seconds count
exceed the int32_t limit will overflow, returning a negative value for
boost::posix_time::time_duration::total_seconds.
The attached file reproduces the issue. The output on a 64-bit Intel(R)
Xeon system running Linux is:
2038-Jan-19 03:14:08
-2147483648
We have found that changing the v_type definition from boost::int32_t to
typename frac_sec_type::int_type resolves the issue by associating v_type
with its implementation's definition.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9489> 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:15 UTC