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.
Also, sort Macquarie more-consistently with other parts of Australia.
This doesn't affect time stamps, just zone selection.
Problems reported by Tim Parenti in
<http://mm.icann.org/pipermail/tz/2013-April/019060.html>.
* australasia (Antarctica/Macquarie): Tasmania Parks & Wildlife Service
history indicates that permanent habitation was 1899-1918 and 1948 on.
* zone.tab (Antarctica/Macquarie): Move next to Lord Howe and Tasmania.
This doesn't affect time stamps, just zone selection.
Problem reported by Tobias Conradi in
<http://mm.icann.org/pipermail/tz/2013-April/019023.html>.
* antarctica (AusAQ, ATAQ): Remove; no longer needed.
* australasia (Antarctica/Macquarie): Move here from
the 'antarctica' file. Use Aus and AT rather than
AusAQ and ATAQ.
* zone.tab (Antarctica/Macquarie): Country code AU, not AQ.
Thanks to Steffen Thorsen, in
<http://mm.icann.org/pipermail/tz/2013-March/018812.html>.
An earlier version of this patch was mistaken.
Thanks to Petr Machata for reporting some of the bugs, in
<http://mm.icann.org/pipermail/tz/2013-March/018814.html>.
* asia (Palestine, Asia/Gaza, Asia/Hebron): Incorporates the latest info
from timeanddate.com about Palestine. When combined with the previous
(incorrect) patch this incorporates the following changes for Gaza and
Hebron:
The spring 2008 change in Gaza and Hebron was on 00:00 Mar 28, not
00:00 Apr 1.
The fall 2009 change in Gaza and Hebron on Sep 4 was at 01:00, not
02:00.
The spring 2010 change in Hebron was 00:00 Mar 26, not 00:01 Mar 27.
timeanddate.com's table says 02:00, but the text at
<http://www.timeanddate.com/news/time/gaza-and-west-bank-dst-2010.html>
says 00:00.
The spring 2011 change in Gaza was 00:01 Apr 1, not 12:01 Apr 2.
timeanddate's table says 00:00, but the text at
<http://www.timeanddate.com/news/time/west-bank-starts-dst-2011.html>
says 00:01.
The spring 2011 change in Hebron on Apr 1 was at 00:01, not 12:01.
The fall 2011 change in Hebron on Sep 30 was at 00:00, not 03:00.
From 2013 on, Gaza and Hebron both observe DST, with the predicted
rules being the last Thursday in March at 24:00 to the first Friday on
or after September 21 at 01:00.
Thanks to Steffen Thorsen, in
<http://mm.icann.org/pipermail/tz/2013-March/018812.html>.
* asia (Palestine): Add rules for 2011 on, to simplify Gaza and Hebron.
Adjust to recently announced changed.
(Asia/Gaza, Asia/Hebron): Use adjusted rules.
* tz-link.htm: Add URLs for webOS, BB10, iOS. Update URL for Solaris.
Mention Internet RFC 6557. Update Internet RFCs 2445->5545,
2822->5322. Switch from FTP to HTTP for Internet RFCs.
The source is: Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
<http://www.jstor.org/stable/1774359>.
* africa (Africa/Gaborone, Africa/Cairo):
* asia (Asia/Rangoon, Asia/Shanghai, Asia/Hong_Kong, Asia/Aden):
* australasia (Pacific/Fiji):
* europe (Europe/Vienna):
* northamerica (America/Nassau, America/Barbados, Atlantic/Bermuda)
(America/Costa_Rica):
* southamerica (America/Bogota, America/Curacao):
Adjust old time stamps to match Milne. I went going through
Milne's list one by one and did not finish, but the rest can be
done later.
* zic.c (stringoffset): Allow 24:00. POSIX.1-2008 allows 24:00,
even though older versions of POSIX maxed out at 23:59:59.
Patch from Arthur David Olson.
* southamerica: Rewrite to avoid the need for Latin-1 bytes.
Perhaps someday we should allow non-ASCII characters in commentary,
but if we do so we should use UTF-8. Reported by Andy Heninger in
<http://mm.icann.org/pipermail/tz/2012-December/018480.html>.
See <http://mm.icann.org/pipermail/tz/2012-July/018103.html>.
* localtime.c (settzname): Ensure that tzname values are set.
(tzload): Get proper behavior when the software is being run on an
unsigned-time_t system but is using data files generated on a
signed-time_t system.
Based on a patch by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018452.html>.
* Makefile (BUGEMAIL): New macro.
(version.h, tzselect): Use it to define REPORT_BUGS_TO.
* tzselect.ksh (REPORT_BUGS_TO): New variable, used for --help.
* zdump.c, zic.c (usage): Use REPORT_BUGS_TO for --help.