Subject: [boost] boost::gregorian::to_tm() initializes some fields of struct tm, but not all
From: Dmitry Goncharov (dgoncharov_at_[hidden])
Date: 2009-02-07 09:43:28
boost::gregorian::to_tm() initializes some fields of struct tm, but not
all. Implementations keep there additional fields.
Besides the fields defined by POSIX libc2.9 has two additional fields in
long int tm_gmtoff; /* Seconds east of UTC. */
__const char *tm_zone; /* Timezone abbreviation. */
long int __tm_gmtoff; /* Seconds east of UTC. */
__const char *__tm_zone; /* Timezone abbreviation. */
There are two additional fields tm_gmtoff and tm_zone.
boost::gregorian::to_tm() does not initialize tm_zone and tm_gmtoff.
There are functions as well which use these additional fields.
E.g. this is a piece of code from the implementation of strftime() from
__strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
zone = (const char *) tp->tm_zone;
if (! (zone && *zone))
zone = "GMT";
This function dereferences tp->tm_zone.
I have not created a ticker since this could be an already known issue.