bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] mktime UTC extremely slow (new in GAWK 4.2)


From: Andrew J. Schorr
Subject: Re: [bug-gawk] mktime UTC extremely slow (new in GAWK 4.2)
Date: Wed, 12 Dec 2018 09:14:39 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Dec 12, 2018 at 01:59:46AM -0700, address@hidden wrote:
> address@hidden wrote:
> 
> > The code itself
> > should be adjusted to also check for mktime_gz, something like:
> >
> >     time_t timegm(struct tm *tm)
> >     {
> >     #ifdef HAVE_MKTIME_GZ
> >             // code here
> >     #else
> >     #error "neither timegm nor mktime_gz avaliable. sorry"
> >     #endif
> >     }
> 
> Ooops.
> 
> I see now that mktime_tz is my own invention. So it'd be better to
> move that code into missing_d/timegm.c as the body of timegm.

I guess you were thinking that a more general function could be useful.
Do you now think it's OK simply to implement timegm rather than
a more general mktime_tz function? The linux timegm man page
shows:
        setenv("TZ", "", 1);
whereas your code does:
        setenv("TZ", tzreq, 1);
and `tzreq' is set to "UTC+0". Do you want to continue to support
the more general case (which would explain why it's not in missing_d),
and if not, what's more portable for setting TZ: "" or "UTC+0"?

Regards,
Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]