[Rd] [musl] Re: Fwd: [musl] strptime() question

Rich Felker dalias at libc.org
Sat Feb 6 23:55:23 CET 2016

On Sat, Feb 06, 2016 at 10:35:28AM -0200, Alba Pompeo wrote:
> It is setting TZ and using tzset(). R is not multi-threaded so it is safe.
> Simon figure out the important settings from the config.log and
> config.h files on a musl system:
> /* #undef USE_INTERNAL_MKTIME */
> #define HAVE_TM_GMTOFF 1
> #define HAVE_TM_ZONE 1
> Does this help anyone debug the issue? Simon just went on vacation.

R's src/main/datetime.c does A LOT of munging to the output of
strptime and I wouldn't be surprised if they're making nonportable
assumptions about it. Note that the underlying C strptime function has
nothing to do with timezones or time conversion; it's basically just a
time-tailored sscanf that reads integers and strings from the input
string and converts them into values in the fields of struct tm.

It also looks like R isn't even calling the system strptime but
instead using its own R_strptime. I think that supports my theory that
the problem is in the munging being done after the string is parsed.


More information about the R-devel mailing list