Opened 13 years ago

Closed 13 years ago

#3308 closed Bugs (fixed)

gregorian does not use 32 bit int on 64 bit system

Reported by: Andre Vehreschild <andre.vehreschild@…> Owned by: az_sw_dude
Milestone: Boost 1.40.0 Component: date_time
Version: Boost 1.39.0 Severity: Showstopper
Keywords: date_time gregorian date 64bit-issue Cc:

Description

The gregorian date datatype is supposed to use a 32-bit integer for storing the date information. At least this is said so in the documentation. Unfortunately the implementation uses "unsigned long" which results in a 64-bit value on 64-bit systems.

I am able to propose attached patch. Please comment and correct!

Attachments (1)

greg_calender_32bit.patch (1.2 KB ) - added by Andre Vehreschild <andre.vehreschild@…> 13 years ago.
Proposed patch using boost::integer.hpp

Download all attachments as: .zip

Change History (4)

by Andre Vehreschild <andre.vehreschild@…>, 13 years ago

Attachment: greg_calender_32bit.patch added

Proposed patch using boost::integer.hpp

comment:1 by Andrey Semashev, 13 years ago

(In [56338]) Refs #3308. Changed the internal type of the gregorian dates to 32 bit integer.

comment:2 by Andrey Semashev, 13 years ago

(In [56372]) Refs #3308. Fixed calculation of difference between dates on 64 bit platforms.

comment:3 by Andrey Semashev, 13 years ago

Resolution: fixed
Status: newclosed

(In [56456]) Fixes #3308. Also added some missing includes.

Note: See TracTickets for help on using tickets.