* m4/stddef_h.m4 (gl_STDDEF_H): The idempotency bug should
be fixed in GCC 13.4 and 14.3, if and when they’re published.
---
 ChangeLog                     | 6 ++++++
 doc/posix-headers/stddef.texi | 2 +-
 lib/stddef.in.h               | 2 +-
 m4/stddef_h.m4                | 8 +++++---
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 99c2c9c893..37bfcc814a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-25  Paul Eggert  <egg...@cs.ucla.edu>
+
+       stddef-h: port better to future GCC 13.4, 14.3
+       * m4/stddef_h.m4 (gl_STDDEF_H): The idempotency bug should
+       be fixed in GCC 13.4 and 14.3, if and when they’re published.
+
 2025-04-25  Bruno Haible  <br...@clisp.org>
 
        unistdio/u*-vasnprintf: Fix handling of grouping rule.
diff --git a/doc/posix-headers/stddef.texi b/doc/posix-headers/stddef.texi
index ac84f00779..7f7af3bdef 100644
--- a/doc/posix-headers/stddef.texi
+++ b/doc/posix-headers/stddef.texi
@@ -47,7 +47,7 @@ stddef.h
 Some platforms define @code{nullptr_t} even when @code{<stddef.h>} is
 not included:
 @c https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869
-GCC 14.0.1 20240411 (Red Hat 14.0.1-0).
+GCC 14
 
 @item
 Some platforms provide an @code{offsetof} macro that cannot be used in
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 3e4a8ec603..dc689b8df8 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -31,7 +31,7 @@
      || defined __need_ptrdiff_t || defined __need_NULL             \
      || defined __need_wint_t)                                      \
     /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \
-       in Fedora 40 with gcc 14.0.1.                                \
+       in GCC 13.3 and 14.2                                         \
        <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>.  */   \
     && !@STDDEF_NOT_IDEMPOTENT@
 /* Special invocation convention inside gcc header files.  In
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index a6bc624314..5011bcd8d1 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,5 +1,5 @@
 # stddef_h.m4
-# serial 19
+# serial 20
 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,
@@ -91,12 +91,14 @@ AC_DEFUN_ONCE([gl_STDDEF_H]
   fi
 
   dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870
-  dnl affects GCC 13 and 14.
+  dnl affects GCC 13.3 and 14.2.
   AC_CACHE_CHECK([whether <stddef.h> is idempotent],
     [gl_cv_stddef_idempotent],
     [AC_COMPILE_IFELSE([AC_LANG_SOURCE(
        [[
-       #if __GNUC__ == 13 || __GNUC__ == 14
+       #if \
+           ((__GNUC__ == 13 && __GNUC_MINOR <= 3) \
+            || (__GNUC__ == 14 && __GNUC_MINOR <= 2))
         #error "bug 114870 is present"
        #endif
        ]])],
-- 
2.49.0


Reply via email to