Subject: bug#79437: 30.2; world-clock silently and incorrectly parses invalid time zone

From: Paul Eggert <[email-masked]>
Date: Sat, 13 Sep 2025 07:57:39 -0700

On 2025-09-12 23:31, Eli Zaretskii wrote:
> I believe specifying
> a non-existent file in timezone invokes undefined behavior

On NetBSD, which has native tzalloc, Emacs signals an error "invalid 
time zone specification".

On other platforms POSIX does not define the behavior, but it's UTC on 
all platforms I know of. In the extremely rare case where wall clock 
time_t (contrary to POSIX) counts leap seconds, it may be UTC without 
leap seconds. The time zone abbreviation is platform-dependent; some 
platforms use "-00", some "UTC", some "GMT", some a string derived from 
TZ's value. My guess is that Jorge's friend's platform used the last 
approach, and used the abbreviation "Europe" which it derived from 
"Europe/Pisa".

We could modify Gnulib's tzalloc to try to detect this situation and 
behave more like native tzalloc. It wouldn't be that easy, though, and 
I'm not sure it's worth the hassle.