On 10/24/20 7:24 AM, Ingo Schwarze wrote:

   https://savannah.gnu.org/bugs/index.php?59276

As I understand it, the problem here is that Gnulib-using C++ code can't use 'restrict' as an identifier. This is worth documenting so I installed the attached patch. It's low priority to try to fix this, as it's a very minor restriction on Gnulib-using C++ code.
>From 7d0b18cc9b553d07e2f60d5315e39e4e82e60033 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sat, 24 Oct 2020 13:35:17 -0700
Subject: [PATCH] =?UTF-8?q?doc:=20mention=20=E2=80=98restrict=E2=80=99=20a?=
 =?UTF-8?q?nd=20C++?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/gnulib-readme.texi (C99 features assumed): Document
that ‘restrict’ should be avoided in C++ code.
---
 ChangeLog              | 6 ++++++
 doc/gnulib-readme.texi | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 39257f6e2..8fa32e1ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-24  Paul Eggert  <egg...@cs.ucla.edu>
+
+	doc: mention ‘restrict’ and C++
+	* doc/gnulib-readme.texi (C99 features assumed): Document
+	that ‘restrict’ should be avoided in C++ code.
+
 2020-10-20  Bernhard Voelker  <m...@bernhard-voelker.de>
 
 	selinux-at, selinux-h: port to SELinux 3.1
diff --git a/doc/gnulib-readme.texi b/doc/gnulib-readme.texi
index 2ec11d554..beb0ca9b6 100644
--- a/doc/gnulib-readme.texi
+++ b/doc/gnulib-readme.texi
@@ -384,6 +384,8 @@ Variadic macros.
 @item
 The @code{restrict} qualifier, assuming
 @code{AC_REQUIRE([AC_C_RESTRICT])} is used.
+This qualifier is sometimes implemented via a macro, so C++ code that
+uses Gnulib should avoid using @code{restrict} as an identifier.
 
 @item
 Flexible array members (however, see the @code{flexmember} module).
-- 
2.25.1

Reply via email to