From: Paul Eggert Date: Mon, 4 May 2026 21:07:12 +0000 (-0700) Subject: Pacify GCC 16 -Wkeyword-macro for ‘restrict’ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e16e872076736447fe5e1bbb6bbb73d982efbe63;p=thirdparty%2Fgnulib.git Pacify GCC 16 -Wkeyword-macro for ‘restrict’ Problem reported by Collin Funk in: https://lists.gnu.org/r/bug-gnulib/2026-05/msg00011.html * m4/gnulib-common.m4 (AC_C_RESTRICT): Sync from Autoconf Savannah git commit b692310133c217edd7cbeeb1ddf592a18dab945f, and override for Autoconf 2.73 and earlier. This protects the "#undef restrict", which may transmute into "#define restrict __restrict__", if ! (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__). --- diff --git a/ChangeLog b/ChangeLog index 93ea77b811..1280ae5e18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2026-05-04 Paul Eggert + + Pacify GCC 16 -Wkeyword-macro for ‘restrict’ + Problem reported by Collin Funk in: + https://lists.gnu.org/r/bug-gnulib/2026-05/msg00011.html + * m4/gnulib-common.m4 (AC_C_RESTRICT): Sync from Autoconf Savannah + git commit b692310133c217edd7cbeeb1ddf592a18dab945f, and override + for Autoconf 2.73 and earlier. This protects the "#undef + restrict", which may transmute into "#define restrict + __restrict__", if ! (defined __STDC_VERSION__ && 199901L <= + __STDC_VERSION__). + 2026-05-03 Bruno Haible acl-permissions: Use the counted_by attribute. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index e11be3cc84..5a804d5b4d 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ # gnulib-common.m4 -# serial 117 +# serial 118 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -1251,9 +1251,9 @@ Amsterdam ]) # AC_C_RESTRICT -# This definition is copied from post-2.70 Autoconf and overrides the -# AC_C_RESTRICT macro from autoconf 2.60..2.70. -m4_version_prereq([2.70.1], [], [ +# This definition is copied from post-2.73 Autoconf and overrides the +# AC_C_RESTRICT macro from autoconf 2.60..2.73. +m4_version_prereq([2.73.1], [], [ AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no @@ -1280,8 +1280,10 @@ AC_DEFUN([AC_C_RESTRICT], AH_VERBATIM([restrict], [/* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is - supported only directly. */ + supported directly. */ +#if ! (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__) #undef restrict +#endif /* Work around a bug in older versions of Sun C++, which did not #define __restrict__ or support _Restrict or __restrict__ even though the corresponding Sun C compiler ended up with