Opened 9 years ago
#9764 new Feature Requests
posix_time::time_duration::operator/(int) can trigger division by zero error
Reported by: | Owned by: | az_sw_dude | |
---|---|---|---|
Milestone: | To Be Determined | Component: | date_time |
Version: | Boost Release Branch | Severity: | Problem |
Keywords: | Cc: |
Description
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 232. It will also cause invalid values to be calculated if the divisor is larger than 231 - 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.
Attachments (1)
Note:
See TracTickets
for help on using tickets.
Reproduction