From 7e844a10182b8243a444bcdd6f473709cc14c68a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 2 Oct 2024 14:41:49 +0200 Subject: [PATCH] Silence -Wunused-const-variable warnings in Gnulib code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Yuri Kanivetsky via Pádraig Brady in . * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Add -Wno-unused-const-variable whenever it is supported. --- ChangeLog | 9 +++++++++ m4/gnulib-common.m4 | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8d38526b3a..3e23303eaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-10-02 Bruno Haible + + Silence -Wunused-const-variable warnings in Gnulib code. + Reported by Yuri Kanivetsky + via Pádraig Brady in + . + * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Add + -Wno-unused-const-variable whenever it is supported. + 2024-10-01 Paul Eggert file-has-acl-tests: omit string.h include diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index e40bb9ddc4..1fec5c5ce1 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -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 -- 2.39.5