@@ -45,9 +45,9 @@ LOCALTIME= GMT
4545#
4646# Any other value for POSIXRULES is obsolete and should not be relied on, as:
4747# * It does not work correctly in popular implementations such as GNU/Linux.
48- # * It does not work in the tzdb implementation for timestamps after 2037.
49- # * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions
50- # at standard time or UT rather than at local time .
48+ # * It does not work even in tzcode, except for historical timestamps
49+ # that precede the last explicit transition in the POSIXRULES file.
50+ # Hence it typically does not work for current and future timestamps .
5151# In short, software should avoid ruleless settings like TZ='EET-2EEST'
5252# and so should not depend on the value of POSIXRULES.
5353#
@@ -122,8 +122,8 @@ LIBDIR = $(TOPDIR)/$(USRDIR)/lib
122122
123123# Types to try, as an alternative to time_t.
124124TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD ) $(TIME_T_ALTERNATIVES_TAIL )
125- TIME_T_ALTERNATIVES_HEAD = int64_t
126- TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
125+ TIME_T_ALTERNATIVES_HEAD = int_least64_t
126+ TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t
127127
128128# What kind of TZif data files to generate. (TZif is the binary time
129129# zone data format that zic generates; see Internet RFC 8536.)
@@ -152,8 +152,10 @@ REDO= posix_right
152152# The EXPIRES_LINE value matters only if REDO's value contains "right".
153153# If you change EXPIRES_LINE, remove the leapseconds file before running "make".
154154# zic's support for the Expires line was introduced in tzdb 2020a,
155- # and EXPIRES_LINE defaults to 0 for now so that the leapseconds file
156- # can be given to older zic implementations.
155+ # and was modified in tzdb 2021b to generate version 4 TZif files.
156+ # EXPIRES_LINE defaults to 0 for now so that the leapseconds file
157+ # can be given to pre-2020a zic implementations and so that TZif files
158+ # built by newer zic implementations can be read by pre-2021b libraries.
157159EXPIRES_LINE = 0
158160
159161# To install data in text form that has all the information of the TZif data,
@@ -210,6 +212,7 @@ LDLIBS=
210212# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
211213# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
212214# localtime_rz can make zdump significantly faster, but is nonstandard.
215+ # -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure.
213216# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
214217# functions like 'link' or variables like 'tzname' required by POSIX
215218# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
@@ -220,7 +223,6 @@ LDLIBS=
220223# -DHAVE_STRTOLL=0 if your system lacks the strtoll function
221224# -DHAVE_SYMLINK=0 if your system lacks the symlink function
222225# -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
223- # -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
224226# -DHAVE_TZSET=0 if your system lacks a tzset function
225227# -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
226228# -Dlocale_t=XXX if your system uses XXX instead of locale_t
@@ -257,22 +259,26 @@ LDLIBS=
257259GCC_INSTRUMENT = \
258260 -fsanitize=undefined -fsanitize-address-use-after-scope \
259261 -fsanitize-undefined-trap-on-error -fstack-protector
262+ # Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow.
260263GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
261264 $(GCC_INSTRUMENT ) \
262265 -Wall -Wextra \
263266 -Walloc-size-larger-than=100000 -Warray-bounds=2 \
264267 -Wbad-function-cast -Wcast-align=strict -Wdate-time \
265268 -Wdeclaration-after-statement -Wdouble-promotion \
269+ -Wduplicated-branches -Wduplicated-cond \
266270 -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
267- -Winit-self -Wjump-misses-init - Wlogical-op \
271+ -Winit-self -Wlogical-op \
268272 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
273+ -Wnull-dereference \
269274 -Wold-style-definition -Woverlength-strings -Wpointer-arith \
270- -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \
275+ -Wshadow -Wshift-overflow=2 -Wstrict-overflow \
276+ -Wstrict-prototypes -Wstringop-overflow=4 \
271277 -Wstringop-truncation -Wsuggest-attribute=cold \
272278 -Wsuggest-attribute=const -Wsuggest-attribute=format \
273279 -Wsuggest-attribute=malloc \
274280 -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
275- -Wtrampolines -Wundef -Wuninitialized -Wunused \
281+ -Wtrampolines -Wundef -Wuninitialized -Wunused-macros \
276282 -Wvariadic-macros -Wvla -Wwrite-strings \
277283 -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
278284 -Wno-type-limits -Wno-unused-parameter
@@ -523,7 +529,7 @@ TZS_YEAR= 2050
523529TZS_CUTOFF_FLAG= -c $( TZS_YEAR)
524530TZS= to$( TZS_YEAR) .tzs
525531TZS_NEW= to$( TZS_YEAR) new.tzs
526- TZS_DEPS= $( PRIMARY_YDATA ) asctime.c localtime.c \
532+ TZS_DEPS= $( YDATA ) asctime.c localtime.c \
527533 private.h tzfile.h zdump.c zic.c
528534# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
529535EIGHT_YARDS = $( COMMON) $( DOCS) $( SOURCES) $( DATA) $( MISC) tzdata.zi
@@ -796,9 +802,10 @@ check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
796802 $( AWK) -f checklinks.awk tzdata.zi
797803 touch $@
798804
799- check_tables: checktab.awk $( PRIMARY_YDATA ) $( ZONETABLES)
805+ check_tables: checktab.awk $( YDATA ) backward $( ZONETABLES)
800806 for tab in $( ZONETABLES) ; do \
801- $( AWK) -f checktab.awk -v zone_table=$$ tab $( PRIMARY_YDATA) \
807+ test " $$ tab" = zone.tab && links=' $(BACKWARD)' || links=' ' ; \
808+ $( AWK) -f checktab.awk -v zone_table=$$ tab $( YDATA) $$ links \
802809 || exit ; \
803810 done
804811 touch $@
@@ -952,6 +959,12 @@ check_public: $(VERSION_DEPS)
952959 public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
953960 done
954961 public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
962+ :
963+ : Also check ' backzone' syntax.
964+ rm public.dir/main.zi
965+ cd public.dir && $(MAKE) PACKRATDATA=backzone main.zi
966+ public.dir/zic -d public.dir/zoneinfo main.zi
967+ :
955968 rm -fr public.dir
956969 touch $@
957970
@@ -964,7 +977,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
964977965978 ln $(VERSION_DEPS) [email protected] 966979 case $@ in \
967- int32_t ) range=-2147483648,2147483648;; \
980+ int*32_t ) range=-2147483648,2147483648;; \
968981 u*) range=0,4294967296;; \
969982 *) range=-4294967296,4294967296;; \
970983 esac && \
0 commit comments