[PATCH 00/59] time: sync mktime from Gnulib

Paul Eggert eggert@cs.ucla.edu
Sun Jan 5 05:56:35 GMT 2025


This patch series syncs mktime from Gnulib.  Among the issues it fixes
is the problem reported by Florian a couple of days ago
in "mktime tm_isdst compatibility improvements"
<https://sourceware.org/pipermail/libc-alpha/2025-January/163342.html>.
This patch series fixes that problem differently from Florian's proposal,
without introducing a new glibc tunable.

Florian Weimer (1):
  time: test DST adjustment for DST-less zones

Paul Eggert (58):
  Split intprops.h into two
  Support stdckdint.h internally if older GCC
  Fix mishandling of default DST rule
  Don't worry about !TZDEFAULT
  Support static_assert in pre-C23 C
  Sync mktime.c from Gnulib 2024-10-04
  Document mktime out-of-range + tm_isdst
  Push tzset lock into callers of time functions
  Omit parse_offset unnecessary *tz == '\0'
  Don’t assume TZif bloat is likely
  tzset no longer calls ftello
  Check TZif files more carefully
  Remove alignment assumption from __tzfile_read
  Treat oddball UTC offset strings as zero
  Simplify __tz_compute
  Improve performance in 2 BC
  Don’t mishandle years < 1970 in compute_change
  Match RFC 9636 names
  Trivial tzset_internal speedup
  Fix obscure bug when stdoffset == dstoffset
  Document assumption that NO_DST == 0
  __use_tzfile is boolean
  Minor tzfile.c clarity improvements
  Stop using zic's -y option
  Fix mishandling of default DST rule
  Simplify treatment of missing and empty TZ
  TZ="" always means UTC sans leap seconds
  Prefer "UTC" for UTC
  Simplify setting tz_rules to UTC
  Update tzname etc. even if TZ is unchanged
  "POSIX TZ" -> "proleptic TZ"
  Reject invalid TZ strings in TZif files
  Reject TZif files containing '\0' in TZ string
  mktime should not consult 'daylight'
  Remove __use_tzfile
  Remove arbitrary limit on TZ, TZDIR lengths
  Tighten setuid TZif file name check
  Avoid a malloc in __tzfile_read
  Free earlier in __tzfile_read
  Improve __tzfile_read TZ="" comment
  Refactor enum tz_rule_type
  __offtime now returns struct tm *
  Fix overflow checking in offtime
  Handle TZif time type 0 correctly
  Remove invalid tzset tests from tst-bz29951.c
  tzset, not localtime, now parses TZif TZ spec
  Minor compute_change widening tweak
  Minor SECSPERDAY widening tweak
  Remove leap-second goto from __tzfile_compute
  Remove use_last label from __tzfile_compute
  Refactor ‘if’ in __tzfile_compute
  Refactor localtime ‘if’ in __tzfile_compute
  Refactor post-transition-table ‘if’
  Refactor __tzfile_compute to avoid two gotos
  Refactor __tzfile_compute index local
  mktime: prefer bool to int
  mktime: port __mktime64 locking to Gnulib
  mktime: improve tm_isdst heuristic

 CONTRIBUTED-BY                     |   9 +
 Makeconfig                         |  16 +-
 NEWS                               |  18 +
 SHARED-FILES                       |   6 +-
 include/intprops-internal.h        | 400 ++++++++++++
 include/intprops.h                 | 356 +----------
 include/stdckdint.h                |   6 +
 include/stdckdint.in.h             |  35 +
 include/sys/cdefs.h                |   8 +
 include/time.h                     |  37 +-
 manual/time.texi                   |  69 +-
 resolv/ns_date.c                   |   2 +-
 sysdeps/generic/netinet/in_systm.h |   2 +-
 sysdeps/nptl/pthread.h             |   2 +-
 time/Makefile                      |   1 +
 time/bits/types/struct_timeb.h     |   2 +-
 time/gmtime.c                      |   8 +-
 time/localtime.c                   |   8 +-
 time/mktime-internal.h             |  14 +-
 time/mktime.c                      | 172 ++---
 time/offtime.c                     |  70 +-
 time/strftime_l.c                  |   3 +-
 time/sys/time.h                    |   2 +-
 time/timegm.c                      |  10 +-
 time/tst-mktime-dst-adjust.c       | 156 +++++
 time/tst-mktime2.c                 |   4 +-
 time/tst-posixtz.c                 |  65 +-
 time/tst-tzname.c                  | 110 +++-
 time/tzfile.c                      | 983 +++++++++++++----------------
 time/tzset.c                       | 510 ++++++++-------
 time/tzset.h                       |  29 +
 timezone/Makefile                  |   5 +-
 timezone/private.h                 |   2 +-
 timezone/test-tz.c                 |   1 +
 timezone/testdata/IST              | Bin 0 -> 285 bytes
 timezone/tst-bz29951.c             |   8 -
 timezone/tst-timezone.c            |  64 +-
 timezone/version                   |   2 +-
 38 files changed, 1865 insertions(+), 1330 deletions(-)
 create mode 100644 include/intprops-internal.h
 create mode 100644 include/stdckdint.h
 create mode 100644 include/stdckdint.in.h
 create mode 100644 time/tst-mktime-dst-adjust.c
 create mode 100644 time/tzset.h
 create mode 100644 timezone/testdata/IST

--
2.45.2



More information about the Libc-alpha mailing list