Other tz file readers had problems with the new pre1970 file, so
remove it and related changes. To recover the pre-1970 data,
instead change pre-1970 Zone entries in other files back to what
they were. Perhaps we'll try to find a better way someday.
* .gitignore: Remove back-pre1970.
* Makefile (BACKWARD): Remove. All uses changed back to 'backward'.
(AWK_SCRIPTS): Remove back-pre1970.awk.
(back-pre1970): Remove.
(clean_misc): Don't rm back-pre1970.
(check_public): Remove special case for pre1970.
* back-pre1970.awk, pre1970: Remove.
* backward (America/Anguilla, America/Antigua, America/Aruba)
(America/Atikokan, America/Blanc-Sablon, America/Cayman)
(America/Creston, America/Curacao, America/Dominica, America/Grenada)
(America/Guadeloupe, America/Montreal, America/Montserrat)
(America/Nassau, America/Port_of_Spain, America/St_Kitts)
(America/St_Lucia, America/St_Thomas, America/St_Vincent)
(America/Tortola): Remove, as these are zones again.
(America/Coral_Harbour, America/Kralendijk, America/Lower_Princes)
(America/Marigot, America/St_Barthelemy, America/Virgin):
Revert to previous links.
* northamerica (Mont, America/Blanc-Sablon, America/Montreal)
(America/Atikokan, America/Creston, America/Anguilla, America/Antigua)
(Bahamas, America/Nassau, America/Cayman, America/Dominica)
(America/Grenada, America/Guadeloupe, America/Montserrat)
(America/St_Kitts, America/St_Lucia, America/St_Vincent)
(America/Tortola, America/St_Thomas):
* southamerica (America/Aruba, America/Curacao, America/Port_of_Spain):
Restore these rules and zones.
* .gitignore: Add back-pre1970.
This lets us preserve information about pre-1970 time stamps when
we change a Zone to a Link to another zone whose time stamps agree
after 1970. This should address concerns about some recent
changes that removed this information. This implementation is a
stripped-down version of a suggestion by Andrew Main (Zefram) in
<http://mm.icann.org/pipermail/tz/2013-August/019615.html> and
<http://mm.icann.org/pipermail/tz/2013-August/019639.html> to
allow filtering tz data by date range. Unlike Zefram's
suggestion, this implementation supports only two date ranges,
namely 1970 on, using 'make BACKWARD=backward'; and all dates,
using 'make BACKWARD="pre1970 back-pre1970"'. At some point I'd
like to improve it to support arbitrary date ranges, but at least
we've now restored the data whose loss was of some concern.
* .gitignore: Add back-pre1970.
* Makefile (BACKWARD): New macro.
(YDATA): Use it instead of 'backward'.
(AWK_SCRIPTS): New macro, with additional script back-pre1970.awk.
(MISC): Use it.
(back-pre1970): New rule.
(clean_misc): Clean back-pre1970. Also clean time.tab, while we're
at it.
(check_public): Don't require pre1970 to stand alone.
* pre1970, back-pre1970.awk: New files.
This is like the previous change, except it entails a change to zone.tab.
The America/Montreal entry was created only because we mistakenly
thought that Montreal's and Toronto's post-1970 time stamps differed.
* backward, northamerica (America/Montreal):
Now a 'backward' link to America/Toronto.
* northamerica (Mont): Remove rules; no longer needed.
(America/Thunder_Bay): Refer to Toronto rules, not Mont.
This doesn't change any time stamps.
* zone.tab (America/Montreal): Remove.
(America/Toronto): Say that it also covers most of Quebec.
This continues in the series of moving entries to 'backward' if
they exist only because of obsolete tz rules about country codes.
In this case, Zone entries are changed to Links; this doesn't
affect any post-1970 time stamps, and the pre-1970 time stamps
are out of scope and are often of dubious reliability.
* backward, northamerica, southamerica (America/Anguilla)
(America/Antigua, America/Aruba, America/Blanc-Sablon)
(America/Cayman, America/Curacao, America/Dominica)
(America/Grenada, America/Guadeloupe, America/Montserrat)
(America/Port_of_Spain, America/St_Kitts, America/St_Lucia)
(America/St_Thomas, America/St_Vincent, America/Tortola):
Now 'backward' links to America/Puerto_Rico.
(America/Atikokan): Now a 'backward' link to America/Panama.
(America/Creston): Now a 'backward' link to America/Phoenix.
(America/Nassau): Now a 'backward' link to America/Toronto.
* backward (America/Coral_Harbour, America/Kralendijk)
(America/Lower_Princes, America/Marigot, America/St_Barthelemy)
(America/Virgin): Adjust to avoid link-to-a-link.
This fixes the 2013-08-15 change so that 'make check' works again.
* backward (America/Shiprock): Move this link here....
* northamerica (America/Shiprock): ... to here.
* tzselect.ksh (LC_ALL): Don't set this, so that the user can
use the locale's decimal point in coordinates.
(convert_coord): Rename from cvt1. All callers changed.
Support more ISO 6709 forms.
* tzselect.8: Document -c better, including the new forms.
These let the user select TZ based on geographical coordinates.
Combining '-c COORD' with '-t time' better insulates the user from
issues of nationality.
* tzselect.8 (SYNOPSIS, OPTIONS): Document the new options.
* tzselect.ksh: Implement them, using the great-circle special
case of the Vicenty formula for distances on ellipsoids.
(LC_ALL): Set to C, since tzselect is English only. That way, we
treat decimal-points in -c option operands the same in all environments.
(usage): Document new options. Document existing ones better.
(output_distances): New variable.
(main): Don't assume SECSPERDAY <= INT_MAX here, since we try
not to assume that sort of thing elsewhere in this file.
Don't rely on undefined behavior in the weird case where
cuthitime < absolute_min_time + SECSPERDAY / 2.
This is a backwards-compatible way of transitioning to a less
politically-charged approach to choosing TZ values. A new time
zone table time.tab acts like zone.tab, except it omits TZ values
that are present only for political reasons. tzselect has a new
"-t zonetabtype" option that lets users select which time zone table
to use, and installers can select the default table. The zone.tab
file does not change, and the default tzselect table for now is
zone.tab. This avoids the backward-compatibility concerns
expressed on the tz mailing list; see, for example,
the discussion surrounding Derick Rethans's comments in
<http://mm.icann.org/pipermail/tz/2013-August/019544.html>
* .gitignore: Add time.tab.
* Makefile (ZONETABTYPE): New macro.
(TABDATA): Add time.tab.
(all): Depend on $(TABDATA).
(install): Do not depend on $(TABDATA), since $(DATA) includes it.
Install time.tab too.
(time.tab): New rule.
(tzselect.tab): Substitute ZONETABTYPE.
* zone-time.awk: New file.
* tzselect.8: Document new options, and --help and --version while
we're at it.
* tzselect.ksh (ZONETABTYPE): New var.
Implement -t ZONETABTYPE option.
Check that no extra operands are given.
* zone.tab: Change first comment line, to distinguish the two
tables better.
This unnecessary duplicate of America/Denver was confusing, as it
incorrectly implied that 'Mountain Time - Navajo' differed from
'Mountain Time' either now or in the past. Clarify this in a
better way, by mentioning in the Arizona entry that it doesn't
include Navajo.
On my platform (Ubuntu 13.04 x86-64, Xeon E3-1225 V2), this sped up
'zdump -V -c 2147483647,2147483648 America/Los_Angeles'
from 13.880 to 0.000 seconds user+system time.
(INTMAX_MAX): Define if the system doesn't.
(SECSPER400YEARS): New macro.
(SECSPER400YEARS_FITS): New constant.
(yeartot): Speed up by using division instead of
repeated subtraction.
* iso3166.tab, zone.tab: Make it clear that country codes aren't
necessarily for countries. Thanks to Derick Rethans for spotting this.
* zone.tab (Antarctica/McMurdo, Europe/Mariehamn, Europe/Sarajevo)
(America/St_Barthelemy, America/Kralendijk, Europe/Busingen)
(Europe/Guernsey, Europe/Zagreb, Europe/Isle_of_Man, Europe/Jersey)
(Europe/Podgorica, America/Marigot, Europe/Skopje, Europe/Ljubljana)
(Arctic/Longyearbyen, Europe/Bratislava, Europe/San_Marino)
(America/Lower_Princes, Europe/Vatican):
Undo recent changes, going back to the way these entries were done
in the last tz distribution. Only the Antarctica/South_Pole change
was retained.
* Makefile (TZDIR_BASENAME): New macro.
(TZDIR): Use it.
(other_two): Remove.
(right_posix, posix_right): Use a symbolic link if supported.
This saves about 2 megabytes' worth of installed files.
This continues in the series of moving entries to 'backward' if
they exist only because of obsolete tz rules about country codes.
This change does not affect any time stamps after 1970. Unlike
the previous change in this series, this one does affect time
stamps before 1970, but that's OK as pre-1970 time stamps are
out of scope for the tz database.
* antarctica (Antarctica/McMurdo, Antarctica/South_Pole):
Move to 'backward' and link to Pacific/Auckland.
* backward: Move links here from 'antarctica'.
* zone.tab: Coalesce McMurdo and South Pole, and add Scott Base
to the description.
* asia (Asia/Dili, Asia/Jakarta, Asia/Pontianak, Asia/Makassar)
(Asia/Jayapura): Use WIB/WITA/WIT rather than WIT/CIT/EIT, since
it's typical to use Indonesian-language abbreviations even when
writing in English. I surveyed the Internet and Google Books and
found several independent English-language sources using WIB/WITA/WIT,
whereas it seemed only tz-inspired sources used WIT/CIT/EIT.
Problem reported several times, by George Ziegler, Priyadi Iman
Nurcahyo, Zakaria, Jason Grimes, Martin Pitt, and Benny Lin;
see Lin's summary of the reports in
<http://mm.icann.org/pipermail/tz/2013-February/018609.html>.
This change does not affect time zone offsets, just alphabetic
abbreviations, such as tm_zone in the BSD-style struct tm.
(Asia/Jakarta): Use BMT, not JMT, for mean time from 1923 to 1932,
as Jakarta was called Batavia back then.
* backward: Move links here from other files, if the only reason
they existed was to fill out zone.tab. Zones are now allowed to
cross national borders, so a zone now need not exist merely
because there's a national border. Sort the list consistently.
None of this changes any time stamp in the database.
* checktab.awk: Don't require that zone.tab's column 3 be unique.
* europe (Europe/Jersey, Europe/Guernsey, Europe/Isle_of_Man)
(Europe/Mariehamn, Europe/Busingen, Europe/Vatican, Europe/San_Marino)
(Arctic/Longyearbyen, Europe/Ljubljana, Europe/Podgorica)
(Europe/Sarajevo, Europe/Skopje, Europe/Zagreb, Europe/Bratislava):
* northamerica (America/St_Barthelemy, America/Marigot):
* southamerica (America/Lower_Princes, America/Kralendijk):
Move links to 'backward'.
* zone.tab: Give more details about how different rows can have
duplicate column 1 or column 3. For each link moved to 'backward',
change column 3 to be the non-backward name.
* date.1: Document -r.
* date.c (main, usage): Support -r.
(main, reset): Remove EBUG code.
(display): New argument NOW. Do not exit; that's now the
caller's responsibility. All callers changed.
(display, timeout, convert, checkfinal, iffy):
Don't assume that localtime and gmtime succeed.
This prevents a core dump for, e.g., 'date -r 0xffffffffffffffff'.
* private.h: Include float.h.
(strtoimax): New macro, for pre-C99 systems that lack strtoimax.
(time_t_min, time_t_max): New constants, from zdump, with
different names to avoid a clash when zdump.c includes private.h.
(tmcomp): Don't mess up when atmp->tm_year - btmp->tm_year overflows.
This can happen when mktime is invoked on a struct tm with tm_year
equal to INT_MIN.
See the thread starting with Clive D.W. Feather's comments in
<http://mm.icann.org/pipermail/tz/2013-August/019496.html>.
* localtime.c (truncate_time): Don't bother with uintmax_t,
as using it doesn't help on any known platform.
* private.h (UINTMAX_MAX): Remove.
Problem reported by Alois Treindl in
<http://mm.icann.org/pipermail/tz/2013-August/019493.html>.
* localtime.c (truncate_time): New function.
(localsub): Use it to avoid undefined behavior on integer overflow.
* private.h (INTMAX_MAX, INTMAX_MIN, UINTMAX_MAX):
New macros, for older platforms that lack them.
* localtime.c (offtime, timeoff, gtime): Revert change to ABI, by
going back to 'long' instead of 'int_fast32_t' for types accepted
and returned by extern functions. Reported by Christos Zoulas in
<http://mm.icann.org/pipermail/tz/2013-July/019488.html>.
* tz-link.htm: Add commentary section. Update URLs and titles.
Add links to Firefox OS, Bill Seymour's intro, Jon Udell's appreciation,
W3C's "Working with Time Zones".
I audited the code and fixed as many width-asssumptions as I could
find, including several places where the code assumed that 'time_t'
was no wider than 'long'; this assumption is not true on 32-bit
NetBSD platforms. This caught every problem that is already fixed
in the NetBSD zic.c, and caught quite a few more.
* Makefile: Add comments re HAVE_DOS_FILE_NAMES and HAVE_INTTYPES_H.
* date.c (checkfinal, netsettime): Don't use 'long' where 'int' will do.
* difftime.c (difftime): Mark with ATTRIBUTE_CONST.
Use uintmax_t, not unsigned long, for the widest unsigned integer type.
Use long double, not double, if time_t is wider than uintmax_t;
this can in theory help on nonstandard platforms, such as GCC
with 64-bit uintmax_t and 128-bit __int128_t.
* localtime.c (struct ttinfo.tt_gmtoff, struct rule.r_time)
(detzcode, getsecs, getoffset, gmtsub, localsub, increment_overflow32)
(normalize_overflow32, time1, time2, timesub, transtime, tzparse)
(time2sub, timeoff, gtime):
* tzfile.h (SECSPERDAY):
* zdump.c (SECSPERDAY):
* zic.c (convert, puttzcode):
Use int_fast32_t, not long, when all we care is that values up to
2**31 can be stored. This doesn't fix any bugs, but it allows
more opportunity for compiler optimization.
(struct lsinfo.ls_corr, timesub, leapcorr):
Use int_fast64_t, not long, when values up to 2**63 can be stored.
(timesub): Make it clearer when we are truncating 0.5 to 0.
(increment_overflow32): Rename from long_increment_overflow.
All uses changed.
(normalize_overflow32): Rename from long_normalize_overflow.
All uses changed.
* private.h (HAVE_INTTYPES_H, ATTRIBUTE_CONST): New macros.
Include <inttypes.h> if HAVE_INTTYPES_H.
(INT_FAST64_MIN, INT_FAST64_MAX, SCNdFAST64, int_fast32_t, PRIdMAX)
(uintmax_t, PRIuMAX, _Noreturn):
Define to reasonable values if it's an older compiler.
* scheck.c (scheck): Add support for arbitrary formats, such as
those that SCNdFAST64 can expand to, at the price of no longer
supporting weird conversion specs like "%[%]".
* strftime.c (_fmt): Use intmax_t and uintmax_t to format time_t,
not long and unsigned long.
* zdump.c (int_fast32_t, intmax_t, PRIdMAX, SCNdMAX):
Define for pre-C99 compilers, like private.h does.
(delta, yeartot, main): Use intmax_t, not long.
(hunt): Use time_t, not long, since the diff must be nonnegative.
(tformat): Allow for time_t wider than long.
* zic.c (ZIC_MIN, ZIC_MAX, SCNdZIC): New macros.
(OFFSET_STRLEN_MAXIMUM, RULE_STRLEN_MAXIMUM): Remove.
(struct rule): Make r_loyear, r_hiyear, r_tod, r_stdoff, z_gmtoff,
z_stdoff zic_t, not long.
(addtype, gethms, oadd, rpytime, tadd, gmtoffs, corr, inleap)
(stringoffset, stringrule, outzone, addtype, adjleap, rpytime)
(LDAYSPERWEEK):
Use zic_t, not long.
(leapminyear, leapmaxyear, min_year, max_year, rulesub, updateminmax)
(outzone, rpytime):
Use zic_t, not int.
(usage): Now _Noreturn.
(main): Use S_IWGRP, not 'unix', to determine whether to call umask.
(writezone): Omit unnecessary cast.
(mkdirs): Use HAVE_DOS_FILE_NAMES, not 'unix', to determine
whether to parse DOS file anmes.
(eitol): Remove; no longer needed.
This change stemmed from a long discussion on the tz mailing list
about what country the Jerusalem zone entry is in. The idea of
this change is to deemphasize the role of countries in the tz
database, to lessen the amount of controversy in the future.
Due to backward compatibility concerns this change does not eliminate
the role of countries entirely. With one minor exception this
change does not alter any code or data, just comments.
* Theory, zone.tab: Deemphasize the role of countries in choosing
location names, as they tend to introduce political conflict
during maintenance, and country information isn't needed for
typical uses of the database.
* Theory: Say that names should differ in more than just case, and why;
and explain why 'backward' means old names will continue to work.
(thanks to Norbert Lindenberg for spotting these issues).
Update citation date and URL.
* iso3166.tab: Mention latest maintenance update.
Update citation URL. Add missing comma for BQ.
Be more consistent about abbreviating Sint like Saint.
Mention SX "Dutch part" for consistency with MF "French part".
* iso3166.tab, zone.tab: Add legal/territorial disclaimer.
* zone.tab: Say that country/zone overlaps can occur in both
directions, and that column 2 need not lie within column 1.
(Asia/Jerusalem): Change the coordinates from a sloppy value,
taken from an old astrology book, to a more-precise value, the
site of city hall. The sloppy value sparked some controversy and
the hope is that the more-precise value will be a bit less
controversial.
* Makefile (TIME_T_ALTERNATIVES): New macro.
(check_time_t_alternatives, clean_misc): New rules.
(clean): Split out into clean_misc and removing tzpublic.
(public): Add check_time_t.
This makes it easier to test on (say) Debian, even if we're
testing the time_t type on (say) NetBSD. NetBSD uses 64-bit
time_t on 32-bit hosts, and this lets us test a NetBSD-style
implementation (32-bit 'long', 64-bit time_t) on a 32-bit Debian host.
* Makefile: Update comments to talk about TIME_T_FLOATING and time_tz.
Sort the comments.
* private.h (restrict): Define to empty with older compilers.
'restrict' is now needed, to define gmtime_r and localtime_r in
standard ways when time_tz is defined.
Make the following changes if time_tz is defined:
(sys_time, time): New static functions. The former is the system
'time' function that applies to the system time_t, the latter
our function that applies to our time_t.
(time_t, ctime, ctime_r, difftime, gmtime, gmtime_r, localtime)
(localtime_r, mktime): Rename to tz_time_t, tz_ctime, etc.,
via macros. Declare the renamed versions.
* zdump.8: Document new options -V, -t.
* zdump.c: Include private.h if time_tz is defined.
(INITIALIZE): Remove; no longer needed.
(absolute_min_time, absolute_max_time): Work even if time_t
is wider than intmax_t, which can be true with GCC and __int128_t.
Use the new TIME_T_FLOATING macro for this.
(usage): Document new flags.
(main): Support them.
Problem reported by Alan Gutierrez in
<http://mm.icann.org/pipermail/tz/2013-May/019368.html>.
* australasia (Antarctica/Macquarie): Rework to avoid problem
when combined with older zic + older localtime.
* localtime.c: Rework to avoid problem when combined with
older Antarctica/Macquarie + older zic.
(struct state): New member defaulttype.
(tzload): Set it.
(localsub): Use it.
* zic.c: Rework to avoid problem when combined with
older Antarctica/Macquarie + older zic.
(writezone): Potentially, set type 0 to that of lowest-valued time.
(outzone): Reserve type 0.