bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] lint warning: mktime: at least one of the values is out o


From: Aharon Robbins
Subject: Re: [bug-gawk] lint warning: mktime: at least one of the values is out of the default range
Date: Wed, 05 Mar 2014 22:25:34 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Hi.

> Date: Wed, 05 Mar 2014 21:14:48 +0100
> From: Hermann Peifer <address@hidden>
> To: "address@hidden" <address@hidden>
> Subject: [bug-gawk] lint warning: mktime: at least one of the values is out
>  of the default range
>
> Hi,
>
> I am getting lint warnings for 24 as hour value:
>
> $ awk --lint 'BEGIN{mktime("2014 1 1 24 0 0")}'
> awk: cmd. line:1: warning: `mktime' is a gawk extension
> awk: cmd. line:1: warning: mktime: at least one of the values is out of 
> the default range
>
> As far as I understand, ISO 8601 allows both 00 and 24 as hour value for 
> midnight and legal minute values are 00 to 59. Is there a (good) reason 
> why lint warnings are generated for hour=24 but not for minute=60 ?

The man page for mktime et. al. show the range as being 0 - 23. That
is why 24 is out of range and produces a lint warning. I think that
the standard to look to here is the ISO C standard, which I don't have
handy, not ISO 8601.

It's just a lint warning, and the C mktime() function should do the
right thing anyway.

But I'll admit that I may be standing on thin ice. :-)

As to why 60 is allowed for minutes, that's probably a mistake -
60 is allowed for seconds to accomodate leap seconds. I should
fix that.

Thanks,

Arnold



reply via email to

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