> Date: Mon, 12 Oct 2026 14:50:00 -0700 > From: Paul Eggert <[email protected]> > Cc: [email protected], [email protected], [email protected] > > On 2026-10-12 13:45, Paul Eggert wrote: > > On 2026-10-12 05:17, Eli Zaretskii wrote: > >> Why do you think the mingw32 doesn't want to replace mktime? > > > > Because of this (in master): > > > > $ git grep mktime nt > > nt/mingw-cfg.site:# Avoid compiling gnulib mktime > > nt/mingw-cfg.site:gl_cv_func_working_mktime=yes > > To fix that, I propose installing the attached. Otherwise I don't see > how mktime could work on mingw, as the system mktime won't sanitize TZ.
We sanitize TZ when we call init_timefns at startup. So I think we are okay with this? If not, why not? I understand what you are saying, and I appreciate, but we disabled the Gnulib replacement of mktime a long time ago and probably for a good reason. I'm guessing that it failed to compile for some reason, probably because it uses __time64_t. Since then, the current arrangement, where we compile lib/mktime, but don't use the Gnulib replacement for the libc function, worked well for us. So I really don't want to start revisiting this now, especially since I cannot afford it any time soon, what with all the people lining up to take care of the Windows build of Emacs. So if the call to tzsanitize at startup is somehow not enough, I prefer to have our own wrapper around mktime that calls tzsanitize than to start using the Gnulib replacement for mktime. Sorry. Btw, I see a call to tzsanitize in lib/mktime.c, but I don't see where it is called from mktime. What did I miss?
