]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
Pacify GCC 16 -Wkeyword-macro for ‘restrict’
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 May 2026 21:07:12 +0000 (14:07 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 May 2026 21:07:55 +0000 (14:07 -0700)
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__).

ChangeLog
m4/gnulib-common.m4

index 93ea77b811a6ba8e780005592ce754141bc0ed45..1280ae5e18a4113a203c9bd8fad0208f77017f71 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <bruno@clisp.org>
 
        acl-permissions: Use the counted_by attribute.
index e11be3cc841413ffb3c0d10a100eb2f5873368a5..5a804d5b4dd786978b346e2e3e9b06a727978655 100644 (file)
@@ -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