Opened 14 years ago

Closed 13 years ago

#1859 closed Bugs (fixed)

boost::gregorian::to_tm() doesn't fill in tm_zone on Mac OS X

Reported by: Phillip Seaver <phil@…> Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc:

Description

On OS X (at least), struct tm contains the tm_zone field:

char    *tm_zone;       /* timezone abbreviation */

Since it's uninitialized, strftime() can crash when it tries to use it.

I'm not sure what the correct fix is -- I worked around it by getting a tm from localtime() and copying its tm_zone field.

I'm using 1.33.1, but it doesn't appear to have changed on the trunk in a way that would fix the problem.

Change History (2)

comment:1 by Andrey Semashev, 14 years ago

Does Mac OS X use glibc? Is this field detectable with USE_BSD or some other macros?

comment:2 by Andrey Semashev, 13 years ago

Resolution: fixed
Status: newclosed

Added zero initialization in revision 53618 (will be released in 1.40). I can't verify if that actually fixes the problem but it is better anyway. If the problem persists, please, reopen.

Note: See TracTickets for help on using tickets.