]> Savannah Git Hosting - gnulib.git/commitdiff
stddef-h: Make a configure test work with upcoming GCC 15.
authorBruno Haible <bruno@clisp.org>
Tue, 8 Apr 2025 09:31:20 +0000 (11:31 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 14 Apr 2025 23:09:20 +0000 (01:09 +0200)
* m4/stddef_h.m4 (gl_STDDEF_H): Replace test "for clean definition" with
one that succeeds in GCC 15.

ChangeLog
m4/stddef_h.m4

index 4ec942b96c5e2730a9f934945e9dec4e47ded9bb..1b0508f32e456924f709a91d5451e99617a7b177 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-08  Bruno Haible  <bruno@clisp.org>
+
+       stddef-h: Make a configure test work with upcoming GCC 15.
+       * m4/stddef_h.m4 (gl_STDDEF_H): Replace test "for clean definition" with
+       one that succeeds in GCC 15.
+
 2025-04-07  Bruno Haible  <bruno@clisp.org>
 
        stdioext: Update comments regarding Haiku.
index c7f75b37fa03d2b8d3c697f3514a0c14ef7efac5..530da5c5887a73edfbaaa654e78d916ae46d32cb 100644 (file)
@@ -1,6 +1,6 @@
 # stddef_h.m4
-# serial 17
-dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
+# serial 19
+dnl Copyright (C) 2009-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -89,24 +89,25 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
     GL_GENERATE_STDDEF_H=true
   fi
 
-  AC_CACHE_CHECK([for clean definition of __STDC_VERSION_STDDEF_H__],
-    [gl_cv_clean_version_stddef],
-    [AC_PREPROC_IFELSE(
-       [AC_LANG_SOURCE(
-          [[/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 */
-            #include <stddef.h>
-            #undef __STDC_VERSION_STDDEF_H__
-            #include <time.h>
-            #ifdef __STDC_VERSION_STDDEF_H__
-            # error "<time.h> defines __STDC_VERSION_STDDEF_H__"
-            #endif
-          ]])],
-        [gl_cv_clean_version_stddef=yes],
-        [gl_cv_clean_version_stddef=no])])
-  if test "$gl_cv_clean_version_stddef" = no; then
-    STDDEF_NOT_IDEMPOTENT=1
-    GL_GENERATE_STDDEF_H=true
-  fi
+  dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870
+  dnl affects GCC 13 and 14.
+  AC_CACHE_CHECK([whether <stddef.h> is idempotent],
+    [gl_cv_stddef_idempotent],
+    [AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+       [[
+       #if __GNUC__ == 13 || __GNUC__ == 14
+        #error "bug 114870 is present"
+       #endif
+       ]])],
+       [gl_cv_stddef_idempotent="guessing yes"],
+       [gl_cv_stddef_idempotent="guessing no"])
+    ])
+  case "$gl_cv_stddef_idempotent" in
+    *yes) ;;
+    *) STDDEF_NOT_IDEMPOTENT=1
+       GL_GENERATE_STDDEF_H=true
+       ;;
+  esac
 
   if $GL_GENERATE_STDDEF_H; then
     gl_NEXT_HEADERS([stddef.h])