From: Paul Eggert Date: Fri, 25 Apr 2025 23:57:48 +0000 (-0700) Subject: stddef-h: port better to future GCC 13.4, 14.3 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=dc79f8d23cd270dcb21f3490dba04c94c92a1bdc;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 99c2c9c893..37bfcc814a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-04-25 Paul Eggert + + 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 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 @@ GCC 12, Clang 15, and other pre-2023 C compilers. Some platforms define @code{nullptr_t} even when @code{} 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 \ . */ \ && !@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 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 ]])],