]> Savannah Git Hosting - gnulib.git/commitdiff
Silence -Wunused-const-variable warnings in Gnulib code.
authorBruno Haible <bruno@clisp.org>
Wed, 2 Oct 2024 12:41:49 +0000 (14:41 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 2 Oct 2024 12:43:29 +0000 (14:43 +0200)
Reported by Yuri Kanivetsky <yuri.kanivetsky@gmail.com>
via Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-10/msg00007.html>.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Add
-Wno-unused-const-variable whenever it is supported.

ChangeLog
m4/gnulib-common.m4

index 8d38526b3aa44f5e263d094cf2859ebdd69fff9e..3e23303eaaffc7e1ad33f6303fca2822e551c5b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-10-02  Bruno Haible  <bruno@clisp.org>
+
+       Silence -Wunused-const-variable warnings in Gnulib code.
+       Reported by Yuri Kanivetsky <yuri.kanivetsky@gmail.com>
+       via Pádraig Brady in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-10/msg00007.html>.
+       * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Add
+       -Wno-unused-const-variable whenever it is supported.
+
 2024-10-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        file-has-acl-tests: omit string.h include
index e40bb9ddc4cbacc0fa348cacefbc14221ac0099d..1fec5c5ce1cdfc4bd37f373865b0732aebc0de2c 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-common.m4
-# serial 104
+# serial 105
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -1380,6 +1380,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
     dnl -Wno-type-limits                      >= 4.3          >= 3.9
     dnl -Wno-undef                            >= 3            >= 3.9
     dnl -Wno-unsuffixed-float-constants       >= 4.5
+    dnl -Wno-unused-const-variable            >= 4.4          >= 3.9
     dnl -Wno-unused-function                  >= 3            >= 3.9
     dnl -Wno-unused-parameter                 >= 3            >= 3.9
     dnl
@@ -1409,6 +1410,9 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
       -Wno-sign-conversion
       -Wno-type-limits
       #endif
+      #if (__GNUC__ + (__GNUC_MINOR__ >= 4) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+      -Wno-unused-const-variable
+      #endif
       #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__)
       -Wno-unsuffixed-float-constants
       #endif