From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9277 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Fwd: [Rd] [musl] strptime() question Date: Sat, 6 Feb 2016 17:55:23 -0500 Message-ID: <20160206225522.GX9349@brightrain.aerifal.cx> References: <20160204160708.GP9349@brightrain.aerifal.cx> <20160204213249.GT9349@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1454799351 24352 80.91.229.3 (6 Feb 2016 22:55:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2016 22:55:51 +0000 (UTC) Cc: r-devel , musl@lists.openwall.com To: Alba Pompeo Original-X-From: musl-return-9290-gllmg-musl=m.gmane.org@lists.openwall.com Sat Feb 06 23:55:46 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aSBlZ-000817-AI for gllmg-musl@m.gmane.org; Sat, 06 Feb 2016 23:55:45 +0100 Original-Received: (qmail 11847 invoked by uid 550); 6 Feb 2016 22:55:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11827 invoked from network); 6 Feb 2016 22:55:40 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9277 Archived-At: 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. Rich