Opened 14 years ago

Closed 13 years ago

#2816 closed Bugs (fixed)

microsec_clock::create_time(TZ_FOR_CREATE tz) causes 64-to-32 bit warning on 64 bit targets

Reported by: pelee@… Owned by: az_sw_dude
Milestone: Boost 1.39.0 Component: date_time
Version: Boost 1.36.0 Severity: Problem
Keywords: Cc:

Description

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).

Change History (2)

comment:1 by Steven Watanabe, 14 years ago

Component: Nonedate_time
Owner: set to az_sw_dude

comment:2 by Andrey Semashev, 13 years ago

Resolution: fixed
Status: newclosed

As the OP notes, fixed in revision 49705. Released in 1.38.

Note: See TracTickets for help on using tickets.