* lib/mini-gmp-gnulib.c [NDEBUG]: Also use -Wunused-variable if clang.
Problem reported for Emacs by Mattias Engdegård.
---
 ChangeLog             | 6 ++++++
 lib/mini-gmp-gnulib.c | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index fb5802d61b..c3723d255a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-04-08  Paul Eggert  <egg...@cs.ucla.edu>
+
+       libgmp: pacify Clang too
+       * lib/mini-gmp-gnulib.c [NDEBUG]: Also use -Wunused-variable if clang.
+       Problem reported for Emacs by Mattias Engdegård.
+
 2022-04-04  Paul Eggert  <egg...@cs.ucla.edu>
 
        init.sh: don’t assume gzip
diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c
index a18ee8f6ab..7d09c80e9e 100644
--- a/lib/mini-gmp-gnulib.c
+++ b/lib/mini-gmp-gnulib.c
@@ -40,7 +40,8 @@
 #endif
 
 /* Pacify GCC -Wunused-variable for variables used only in 'assert' calls.  */
-#if defined NDEBUG && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+#if (defined NDEBUG \
+     && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || defined __clang__))
 # pragma GCC diagnostic ignored "-Wunused-variable"
 #endif
 
-- 
2.35.1


Reply via email to