[Boost-bugs] [Boost C++ Libraries] #9764: posix_time::time_duration::operator/(int) can trigger division by zero error

Subject: [Boost-bugs] [Boost C++ Libraries] #9764: posix_time::time_duration::operator/(int) can trigger division by zero error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-10 11:12:22


#9764: posix_time::time_duration::operator/(int) can trigger division by zero
error
-------------------------------------------------+-------------------------
 Reporter: MichaÅ‚ Åšlizak | Owner: az_sw_dude
  <michal.slizak+boost@…> | Status: new
     Type: Feature Requests | Component: date_time
Milestone: To Be Determined | Severity: Problem
  Version: Boost Release Branch |
 Keywords: |
-------------------------------------------------+-------------------------
 When dividing time_duration by a 64-bit integer the divisor will be
 implicitly cast to 'int' type (32-bits on most platforms).

 This will cause 'division by zero' runtime error for any value which is a
 multiple of 2^32^.
 It will also cause invalid values to be calculated if the divisor is
 larger than 2^31^ - 1.

 I don't see any reason why the time_duration interface should be limited
 to division by 32-bit integer values on systems where the storage type
 used in time_duration is at least 64-bit long.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9764>
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