Commit Graph
3444 Commits
Author SHA1 Message Date
Paul Eggert 96eff14f85 Simplify configuration of TM_GMTOFF and TM_ZONE.
* private.h, zdump.c (_GNU_SOURCE): New macro.
(TM_GMTOFF) [!NO_TM_GMTOFF]:
(TM_ZONE) [!NO_TM_ZONE]: Guess definition if not already defined.
* Makefile, NEWS: Document the above.
2014-08-25 08:19:48 -07:00
Paul Eggert 2f7599d358 Port to GCC 3.4.6, which does not define __LONG_LONG_MIN__ on Irix.
* private.h (INT_FAST64_MIN, INTMAX_MIN): Don't use
__LONG_LONG_MIN__ when defining backwards-compatibility workaround.
2014-08-25 08:19:48 -07:00
Paul Eggert 1f5348d829 Minor library fixes for signed integer overflow.
* localtime.c (localsub, time2sub): Don't assume that signed
integer overflow wraps around.
2014-08-25 08:19:48 -07:00
Paul Eggert 13a277175c Fix some bugs and potential crashes with bad data in zone files.
* localtime.c (tzload): Avoid undefined behavior on integer overflow
when reading a file containing integers out of machine range.
Simplify some of the existing overflow checking.
Handle out-of-range leap-second transitions similarly to the
way we now handle out-of-range ordinary transitions.
* NEWS: Document this and other recent fixes.
2014-08-25 08:19:48 -07:00
Paul Eggert 10ac30643e * Makefile (check_time_t_alternatives): Pass REDO to submake. 2014-08-25 08:19:48 -07:00
Paul Eggert 6292f17b4f * localtime.c (tzload): Reject files with out-of-order transitions. 2014-08-25 08:19:48 -07:00
Paul Eggert aaebb8e386 Port to platforms with leap seconds and unsigned time_t.
* localtime.c (tzload): On platforms where time_t is unsigned,
don't mishandle zones that contain leap seconds but no ordinary
transitions after 1970.  This problem can be reproduced by running
'zdump -v right/Asia/Dubai' on a platform where time_t is an
unsigned 32-bit integer.
2014-08-25 08:19:48 -07:00
Paul Eggert 35bcc1d40a * NEWS: Fix sign typo in Turks & Caicos news. (Thanks to Matt Johnson.) 2014-08-25 08:19:48 -07:00
Paul Eggert 23fe9ad77a Simplify new Turks & Caicos rules.
* northamerica (TC): Remove, as it's now a duplicate of the US rules.
Remove obsolescent comment about this.
(America/Grand_Turk): Use US rather than TC.
2014-08-25 08:19:48 -07:00
Paul Eggert d7c4d73ba3 * northamerica (TC, America/Grand_Turk): Switch from EST/EDT to AST.
* NEWS: Document this.
2014-08-25 08:19:48 -07:00
Paul Eggert 253d158c17 zic: check more consistently for I/O errors and improve diagnostics
* zic.c (warnings): New static var.
(warning): Set it here.
(size_product, growalloc, main): Translate diagnostic.
(verror): Don't increment errors here.
(error): Set it here.
(close_file): New function.
(usage, dolink, infile, writezone): Use it.
(usage): Fit diagnostic in output lines better.
(main): Prefer 'return X;' to 'exit(X);'.
(main, infile, mkdirs): Use 'warning' for warnings.
Check for stderr output error.
(dolink, mkdirs): Don't assume gettext preserves errno.
2014-08-25 08:19:48 -07:00
Paul Eggert 4ad336d57a zdump: check more consistently for output errors
* zdump.c: Include <errno.h>.
(errout): New static var.
(my_localtime) [!TYPECHECK]
(abbrok): Set it.
(close_file): New function.
(usage, main): Use it.
(main): Prefer 'return X;' to 'exit(X);'.
Check for stderr output error.
2014-08-25 08:19:48 -07:00
Paul Eggert 5bfa967c17 Avoid (void) before calls.
Although the cast to void in usage like '(void) printf ("Hello")'
may have been helpful decades ago when Lint Was Your Friend,
nowadays such casts are not helpful.  The tz code is currently not
consistent about this: sometimes the casts are present, and
sometimes absent.  As they make the code harder to read, let's
remove them.
* asctime.c, date.c, ialloc.c, localtime.c, strftime.c, zdump.c, zic.c:
Don't cast calls to 'void'.
2014-08-25 08:19:47 -07:00
Paul Eggert 11f5ff1129 * Makefile (strftime.o): Depend on private.h. 2014-08-25 08:19:47 -07:00
Paul Eggert fe7e48bcf5 * localtime.c (tzsetwall): Define only if STD_INSPIRED.
This removes lint in the !STD_INSPIRED case, as this function
is now unused in that case.
2014-08-25 08:19:47 -07:00
Paul Eggert 64399fc596 Make the library thread-safe if THREAD_SAFE is defined.
* localtime.c [THREAD_SAFE]: Include pthread.h.
(VOLATILE): New macro.
(locallock) [THREAD_SAFE]: New static var.
(lock, unlock): New functions.
(lcl_is_set, gmt_is_set): Now VOLATILE.
(tzsetwall): Move cleaned-up guts to new function tzsetwall_unlocked,
for which this is now merely a locking wrapper.
(tzset): Similarly, for new function tzset_unlocked.
(localsub): Don't set tzname here; that's not thread-safe.
This change can lose information on hosts without TM_ZONE,
but there is no reliable way to fix that in a thread-safe way.
(localtime_tzset): New function, which does proper locking.
(localtime, localtime_r): Use it.
(gmtsub): Do not worry about initializing gmtptr, as that's now
the caller's responsibility.
(gmtime): Reimplement in terms of gmtime_r.
(timegm): Reimplement in terms of timeoff.
(gmtime_r, offtime, mktime, timeoff, time2posix, posix2time):
Lock at start and unlock at end.
* Makefile, NEWS: Document this.
2014-08-25 08:19:47 -07:00
Paul Eggert 4d86b313aa * private.h (timegm, timelocal) [time_tz]: Define replacements.
Needed on Ubuntu 14.04 when compiling with -D_GNU_SOURCE -Dtime_tz=....
2014-08-25 08:19:47 -07:00
Paul Eggert aedcce3e83 Remove lint when debugging by compiling with -Dtime_tz='whatever'.
* localtime.c (LOCALTIME_IMPLEMENTATION): New macro.
(time) [time_tz]: Move here from private.h, and make external.
* private.h (sys_time) [time_tz]: Define only if
LOCALTIME_IMPLEMENTATION, so that the code doesn't define an unused
static function sys_time that the compiler might complain about.
(time) [time_tz]: Move to localtime.c.
* NEWS: Document this.
2014-08-25 08:19:47 -07:00
Paul Eggert 6bc7f54afa * date.c, localtime.c, zdump.c: Simplify prototypes for static functions
by removing prototypes that aren't needed, and by removing names
of arguments.  This will make future changes simpler and easier to
follow.
* NEWS: Document this.
2014-08-25 08:19:47 -07:00
Paul Eggert a253a3f97e Port to GCC 4.1.3 + NetBSD 5.1.
* private.h (INT_FAST32_MAX, INT_FAST32_MIN):
Define if not already defined, since localtime.c uses them.
2014-08-25 08:19:47 -07:00
Paul Eggert ad6d5fe9e6 Port to NetBSD when using GCC_DEBUG_FLAGS or defining time_tz.
* private.h (offtime, posix2time, time2posix, timeoff) [time_tz]:
Define tz_* replacements for these functions too.
(asctime_r): Move to after time_tz definitions, to keep like
declarations together.
(tzsetwall) [STD_INSPIRED]: Declare if not defined.
(offtime, timeoff, time2posix, posix2time) [STD_INSPIRED]:
Declare if not defined, or if time_tz is defined.
* NEWS: Document this.
2014-08-25 08:19:47 -07:00
Paul Eggert a95a6ddad1 date: port to Ubuntu 14.04 with -DHAVE_UTMPX_H=1
* date.c (WTMPX_FILE): Define to _PATH_WTMPX if not already defined
and if _PATH_WTMPX is defined.
(reset): Do not use WTMPX_FILE if it is not defined.
* NEWS: Document this.
2014-08-25 08:19:47 -07:00
Tim Parenti 3962fae49c Better align end-of-line comments within Zones.
Per a suggestion from Alan Barrett:
http://mm.icann.org/pipermail/tz/2014-August/021416.html

Also some minor commentary changes to fit within 80 columns.
2014-08-16 22:48:03 -07:00
Tim Parenti 247d909702 More spacing fixes within UNTIL fields. 2014-08-16 22:48:03 -07:00
Tim Parenti 78e3924ea4 Rename fields of Link lines for clarity.
* zic.8, zoneinfo2tdf.pl: Change names of Link line fields to be more
descriptive and more like the parameters of 'ln'.  LINK-FROM becomes
TARGET, and LINK-TO becomes LINK-NAME.
* backward: Add a '# Link' header.
* europe, northamerica: Add a few '# Zone' headers where needed.
* NEWS: Document this.
2014-08-16 22:48:03 -07:00
Paul Eggert c3800e77d6 * backzone: Explain Zone columns. 2014-08-16 22:48:03 -07:00
Tim Parenti 3b64b02631 * NEWS: Typo fix. 2014-08-14 14:23:09 -07:00
Paul Eggert 0a5fcf8d0d * asia, NEWS: Update Philippines commentary. 2014-08-14 13:32:53 -07:00
Paul Eggert 7217d26487 * backzone: Fix misspelling (Thanks to Michael Deckers). 2014-08-13 11:46:39 -07:00
Paul Eggert 0f4a8f01fc * CONTRIBUTING: Clarify how to repeat the git workflow.
* NEWS: Thanks.
2014-08-13 08:02:56 -07:00
Paul Eggert 198708147f Reword so that it does not matter whether the word "data" is plural. 2014-08-12 22:20:23 -07:00
Paul Eggert ad420e19ef * time2posix.3, tzfile.5: Use ASCII double-quote only for C strings. 2014-08-12 19:00:04 -07:00
Paul Eggert 11be44dce3 The word "data" is plural. 2014-08-12 18:03:14 -07:00
Paul Eggert 94f941ebd1 Move out-of-scope UTC+1 African zones to 'backzone'.
This illustrates how 'backzone' can be used to migrate
out-of-scope data out of the database proper.
* africa (Africa/Luanda, Africa/Porto-Novo, Africa/Douala, Africa/Bangui)
(Africa/Kinshasa, Africa/Brazzaville, Africa/Malabo, Africa/Libreville)
(Africa/Niamey): Change these from zones to links (to Africa/Lagos).
Move their old data from here ...
* backzone: ... to here.
* checktab.awk (tztab): Remove special cases for these zones.
* NEWS: Document the above.
2014-08-12 17:38:43 -07:00
Paul Eggert ac5bf48519 New data file 'backzone' for out-of-scope and/or poorly-sourced data.
* backzone: New file.
* Makefile (DATA): Add backzone.
(check_character_set): Check it.
(posix_packrat): New rule.
(.PHONY): Add it.
* NEWS: Document the above.
2014-08-12 17:38:35 -07:00
Paul Eggert e107ce8107 * Makefile (.PHONY): Add check_white_space. 2014-08-12 11:30:30 -07:00
Paul Eggert 3b4c54b5b7 * Makefile (check_character_set): Check CONTRIBUTING like README. 2014-08-12 01:12:34 -07:00
Paul Eggert bc9b5b8914 Distribute Theory as part of the tzdata tarball too.
(Suggested by Alan Barrett.)
* Makefile (COMMON): Move Theory here ...
(DOCS): From here.
* NEWS: Document this.
2014-08-12 01:10:09 -07:00
Paul Eggert 319a80ff38 Fix misspelling in previous patch. 2014-08-11 18:46:05 -07:00
Paul Eggert 62711791c3 tzselect: improve heuristic in Africa
Add the product of the longitude difference and the cosine of the
latitude farther from the equator to the distance measure.  This
works better for the Congolese test case noted by Alan Barrett in:
http://mm.icann.org/pipermail/tz/2014-July/021229.html
The new heuristic is not perfect, but no heuristic is.
* tzselect.ksh (abs, min): New functions
(convert_coord): Rename local to avoid name clash.
(gcdist): Rename from dist.
(pardist, dist): New functions.
* NEWS: Document this.
2014-08-11 18:41:32 -07:00
Paul Eggert 67d9b6ac6b * tzselect.ksh: Fix typo in implementation of undocumented -t option. 2014-08-11 17:13:25 -07:00
Paul Eggert ac652d59bb * CONTRIBUTING: New file.
* Makefile (COMMON): Add it.
* README, NEWS, Theory, africa, asia, australasia, europe:
* northamerica, southamerica: Mention it.
2014-08-11 16:03:52 -07:00
Paul Eggert 3405f9c2fb * tz-link.htm, NEWS: Mention HP-UX (and Windows in another place). 2014-08-11 15:20:17 -07:00
Paul Eggert 63ce01cfa8 * europe: Fix some broken British URLs. (Thanks to Lester Caine.)
* NEWS: Document this.
2014-08-11 13:01:24 -07:00
Paul Eggert f02ca7c6ef Shift the load a little between the two tarballs.
(Thanks to Alan Barrett for the suggestion.)
* Makefile (SOURCES): Move workman.sh here, from $(MISC).
(COMMON): Move NEWS here, from $(DOCS).
(tzdata$(VERSION).tar.gz): Move $(MISC) here, from
tzcode$(VERSION).tar.gz.
* NEWS: Document the above.
2014-08-11 12:32:48 -07:00
Paul Eggert 0512625db7 Improve checks for white space.
* Makefile (check_white_space): Rename from check_tabs; all uses
changed.  Also check for trailing white space and for oddball
ASCII white space characters.
2014-08-11 11:53:14 -07:00
Paul Eggert bdd2d3331b * tz-link.htm: Consolidate and tighten up Windows description.
* NEWS: Mention Windows-related doc changes.
2014-08-11 11:53:06 -07:00
Matt Johnson 1b1a1ecad4 * tz-link.htm: Update info about Microsoft Windows. 2014-08-11 10:48:24 -07:00
Paul Eggert 115b6002d8 Adjust pre-1912 Portuguese transitions in the light of the 1911 decree.
(Thanks to Stephen Colebourne for a heads-up about the decree.)
* africa (Africa/Luanda, Africa/Bissau):
Change transition date to 1912-01-01.
(Atlantic/Cape_Verde, Africa/Maputo):
Add commentary about the switch.
* asia (Asia/Kolkata): Add commentary about Portuguese India.
* europe (Europe/Lisbon): Change Lisbon Mean Time from -0:36:32
to -0:36:45 (rounded from -0:36:44.68).
(Atlantic/Azores, Atlantic/Madeira):
Change transition date to 1912-01-01.
* NEWS: Document the above.
2014-08-11 00:28:13 -07:00
Paul Eggert 66e421de78 * northamerica: Remove no-longer-working mccsc.edu link.
(Thanks to Nathan Stratton Treadway.)
2014-08-10 15:28:45 -07:00