[tz] [PROPOSED] Fix ‘make check_time_t_alternatives’

Paul Eggert eggert at cs.ucla.edu
Wed Mar 24 04:51:13 UTC 2021

* zic.c (EPOCH_LOCAL, EPOCH_OFFSET, time_tz): #undef, so that zic
uses the system ‘time’ function instead of relying on any
replacement.  That way, zic doesn’t depend on localtime.c.
This fixes a problem introduced in
2021-02-23T07:03:07Z!eggert at cs.ucla.edu when zic.c started using
the ‘time’ function to generate crude random numbers.
 zic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/zic.c b/zic.c
index 6c38bd7..d1e9a97 100644
--- a/zic.c
+++ b/zic.c
@@ -5,6 +5,12 @@
 ** 2006-07-17 by Arthur David Olson.
+/* Use the system 'time' function, instead of any private replacement.
+   This avoids creating an unnecessary dependency on localtime.c.  */
+#undef time_tz
 #include "version.h"
 #include "private.h"
 #include "tzfile.h"

More information about the tz mailing list