+2024-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ mktime: don’t consult daylight
+ * lib/mktime.c (__mktime_internal): Do not consult __daylight
+ as it has unreliable contents - among other things, the user
+ can set it. It also wasn’t being configured properly for
+ mingw-w64; this problem was reported by Markus Muetzel in
+ <https://lists.gnu.org/r/bug-gnulib/2024-11/msg00126.html>.
+ * m4/mktime.m4 (gl_PREREQ_MKTIME): Do not check for ‘daylight’;
+ no longer needed.
+
2024-11-14 Bruno Haible <bruno@clisp.org>
Eliminate gcc -Wzero-as-null-pointer-constant warnings.
int mon = tp->tm_mon;
int year_requested = tp->tm_year;
- /* If the timezone never observes DST, ignore any tm_isdst request. */
- int isdst = local && __daylight ? tp->tm_isdst : 0;
+ /* Ignore any tm_isdst request for timegm. */
+ int isdst = local ? tp->tm_isdst : 0;
/* 1 if the previous probe was DST. */
int dst2 = 0;
# mktime.m4
-# serial 41
+# serial 42
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
])
# Prerequisites of lib/mktime.c.
-AC_DEFUN([gl_PREREQ_MKTIME], [
- AC_CACHE_CHECK([spelling of daylight variable],
- [gl_cv_var___daylight],
- [for gl_cv_var___daylight in __daylight daylight _daylight 1; do
- test $gl_cv_var___daylight = 1 && break
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <time.h>
- ]],
- [[return $gl_cv_var___daylight;]])
- ],
- [break])
- done])
- AS_CASE([$gl_cv_var___daylight],
- [__daylight], [],
- [AC_DEFINE_UNQUOTED([__daylight], [$gl_cv_var___daylight],
- [Define to an expression equivalent to <time.h> daylight
- if <time.h> __daylight does not already do that.])])
-])
+AC_DEFUN([gl_PREREQ_MKTIME], [:])