From: Bruno Haible Date: Tue, 12 May 2026 19:29:30 +0000 (+0200) Subject: build: Silence some warnings from gcc 16, part 2. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=fbabf2d18561f2854087bad155db846eb4bb8cc7;p=thirdparty%2Fgettext.git build: Silence some warnings from gcc 16, part 2. * m4/more-warnings.m4 (gt_MORE_WARNINGS): Don't add a -Wno-useless-cast option for gcc versions < 14. --- diff --git a/m4/more-warnings.m4 b/m4/more-warnings.m4 index e0ba29b9b..c095c539f 100644 --- a/m4/more-warnings.m4 +++ b/m4/more-warnings.m4 @@ -1,5 +1,5 @@ # more-warnings.m4 -# serial 7 (gettext-1.1) +# serial 8 (gettext-1.1) dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -48,8 +48,14 @@ AS_HELP_STRING([[--disable-more-warnings]], [obey exactly the warning options sp dnl First, the warnings that are generated already with -O0: dnl These warnings enforce a certain programming style that is not ours. nw="$nw -Wempty-body" - nw="$nw -Wuseless-cast" nw="$nw -Wvla" + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + #if __GNUC__ < 14 + #error "Option did not exist" + #endif + ]])], + [nw="$nw -Wuseless-cast" + ]) dnl All warnings produced by these options (in gcc 13) have been false dnl alarms. nw="$nw -Wanalyzer-double-fclose" @@ -150,7 +156,7 @@ AS_HELP_STRING([[--disable-more-warnings]], [obey exactly the warning options sp dnl length buffer [-Wstack-protector]". nw="$nw -Wstack-protector" dnl With GCC 11 and older, these warnings are pointless: - dnl "[-Wanalyzer-use-after-free], "[-Wanalyzer-free-of-non-heap]". + dnl "[-Wanalyzer-use-after-free]", "[-Wanalyzer-free-of-non-heap]". AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #if __GNUC__ > 11 #error "You are lucky"