[tz] question about mktime_tzname()

Paul Eggert eggert at cs.ucla.edu
Wed Jan 11 21:51:18 UTC 2017


On 01/11/2017 01:28 PM, Arthur David Olson wrote:
> When a table generated from an environment variable does indeed cover
> 400 years, both goahead and goback should be set.

The localtime.c code in question tries to do that sort of thing, as it says:

            yearlim = EPOCH_YEAR + YEARSPERREPEAT;
            for (year = EPOCH_YEAR; year < yearlim; year++) {

and YEARSPERREPEAT is 400.

Unfortunately now that I think of it, I see that this can't work on
hosts with 32-bit time_t, as they can't cover the 400-year span.  So the
code is still broken on 32-bit hosts. Is there a better way to fix the code?

Also, I'm puzzled as to why the first transition in 1970 was being
omitted, as that leads me to worry that the above code will generate one
transition shy of 400 years' worth even on 64-bit hosts.



More information about the tz mailing list