[tz] [PROPOSED 4/5] 'zic -b slim' now omits isstd, isut

Paul Eggert eggert at cs.ucla.edu
Tue Jun 18 19:12:15 UTC 2019


The new '-b slim' option of zic now omits the isstd and isut
tables in TZif files.  Because the intended use of these tables
often fails in practice and has been deprecated, we might as well
drop them when the user specifies the new '-b slim' option.
This change does not affect zic's default behavior, and does not
affect the behavior of ‘zic -b slim -p America/New_York’, so the
old System V behavior still works even with -b slim.
* Makefile, NEWS, zic.8: Adjust comments accordingly.
* zic.c (addtype): Omit isstd and isut if '-b slim'.
---
 Makefile |  2 ++
 NEWS     | 19 ++++++++++---------
 zic.8    |  7 ++++++-
 zic.c    |  2 ++
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index cda95ea..81d1e86 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,8 @@ LOCALTIME=	GMT
 # Nonempty POSIXRULES is obsolete and should not be relied on, because:
 # * It does not work correctly in popular implementations such as GNU/Linux.
 # * It does not work in the tzdb implementation for timestamps after 2037.
+# * It is incompatible with ’zic -b slim’ if POSIXRULES specifies transitions
+#   at standard time or UT rather than at local time.
 # In short, software should avoid ruleless settings like TZ='EET-2EEST'
 # and so should not depend on the value of POSIXRULES.
 
diff --git a/NEWS b/NEWS
index fffe1b6..53c440c 100644
--- a/NEWS
+++ b/NEWS
@@ -46,15 +46,16 @@ Unreleased, experimental changes
     test for year-2038 bugs in software that reads TZif files.
     'zic -b fat' and 'zic -b slim' generate larger and smaller output;
     for example, changing from fat to slim shrinks the Europe/London
-    file from 3648 to 1625 bytes, saving about 55%.  Fat and slim
-    files represent the same time data and use the same TZif format as
-    documented in tzfile(5) and in Internet RFC 8536.  Fat format
-    attempts to work around bugs or incompatibilities on older
-    software that reads TZif files, notably software that mishandles
-    64-bit TZif data.  Slim format is more efficient and tests for
-    these bugs.  Currently zic defaults to fat format, although this
-    is intended to change in future zic versions, as the buggy
-    software typically mishandles post-2038 timestamps anyway.
+    file from 3648 to 1599 bytes, saving about 56%.  Fat and slim
+    files represent the same set of timestamps and use the same TZif
+    format as documented in tzfile(5) and in Internet RFC 8536.
+    Fat format attempts to work around bugs or incompatibilities in
+    older software, notably software that mishandles 64-bit TZif data
+    or uses obsolete TZ strings like "EET-2EEST" that lack DST rules.
+    Slim format is more efficient and does not work around 64-bit bugs
+    or obsolete TZ strings.  Currently zic defaults to fat format,
+    although this is intended to change in future zic versions, as the
+    buggy software often mishandles timestamps anyway.
 
     zic no longer treats a set of rules ending in 2037 specially.
     Previously, zic assumed that such a ruleset meant that future
diff --git a/zic.8 b/zic.8
index 4bf69a5..dc0220f 100644
--- a/zic.8
+++ b/zic.8
@@ -103,7 +103,12 @@ will act as if the input contained a link line of the form
 Link	\fItimezone\fP		posixrules
 .sp
 This feature is obsolete and poorly supported.
-Among other things it should not be used for timestamps after the year 2037.
+Among other things it should not be used for timestamps after the year 2037,
+and it should not be combined with
+.B "\*-b slim"
+if
+.IR timezone 's
+transitions are at standard time or UT instead of local time.
 .TP
 .BR "\*-r " "[\fB@\fP\fIlo\fP][\fB/@\fP\fIhi\fP]"
 Reduce the size of output files by limiting their applicability
diff --git a/zic.c b/zic.c
index 3fb32c7..5da3ca4 100644
--- a/zic.c
+++ b/zic.c
@@ -2930,6 +2930,8 @@ addtype(zic_t utoff, char const *abbr, bool isdst, bool ttisstd, bool ttisut)
 		error(_("UT offset out of range"));
 		exit(EXIT_FAILURE);
 	}
+	if (!want_bloat())
+	  ttisstd = ttisut = false;
 
 	for (j = 0; j < charcnt; ++j)
 		if (strcmp(&chars[j], abbr) == 0)
-- 
2.21.0



More information about the tz mailing list