On 2024-09-16 00:16, Bruno Haible wrote:
How about, instead of defining two macros
_GL_FUNCDECL_SYS (func, rettype, parameters);
_GL_FUNCATTR_SYS (func, rettype, parameters, attributes);
we would have one macro
_GL_FUNCDECL_SYS (func, rettype, parameters, attributes);
and invoke it with 4 arguments always,
Thanks, that sounds nicer. I did that. My earlier patch had been
assuming we couldn't use that C99 feature; I also documented that we're
assuming C99 empty macro args by installing the attached additional patch.
The current code doesn't check for portability to strict C17 and
earlier, when compiling with recent GCC. Although it could be
complicated to do so I hope the complexity isn't necessary, as we can
check by compiling with stricter C17- compilers.From 3cbc5ea46fee3a9617bd9478dc8f75bc6cb135ca Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Mon, 16 Sep 2024 09:54:08 -0700
Subject: [PATCH] Document use of empty macro args.
---
ChangeLog | 2 ++
doc/gnulib-readme.texi | 3 +++
2 files changed, 5 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 8bf9e172c5..d4f3555e6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@
one is empty. Although this change requires C99 or later, that’s
safe nowadays. Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-09/msg00079.html
+ * doc/gnulib-readme.texi (C99 features assumed):
+ Document that we assume this C99 feature.
* lib/c++defs.h (_GL_FUNCDECL_RPL, _GL_FUNCDECL_SYS):
Revert yesterday’s changes. All callers changed.
Add comments explaining the required comma before missing attrs.
diff --git a/doc/gnulib-readme.texi b/doc/gnulib-readme.texi
index 25d7b54e2c..eafb3a0b01 100644
--- a/doc/gnulib-readme.texi
+++ b/doc/gnulib-readme.texi
@@ -376,6 +376,9 @@ it directly, preferring plain @code{bool} via the
@item
Compound literals and designated initializers.
+@item
+Empty arguments in macro calls.
+
@item
Variadic macros.@*
@findex __VA_ARGS__
--
2.43.0