From a685bc1480a54c56a8001cbd600542439a81b82c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 6 Aug 2024 17:28:35 +0100 Subject: [PATCH] acinclude.m4: Disable -Winline warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 14.2.1 gives warnings like: In file included from memory.h:26, from augmatch.c:30: In function ‘guess_lens_name’, inlined from ‘main’ at augmatch.c:396:16: internal.h:229:19: error: inlining failed in call to ‘streqv’: call is unlikely and code size would grow [-Werror=inline] 229 | static inline int streqv(const char *a, const char *b) { | ^~~~~~ augmatch.c:294:9: note: called from here 294 | if (streqv(ext, ".json")) { | ^~~~~~~~~~~~~~~~~~~~ These warnings don't seem very useful in Augeas, since we are not so sensitive to code size and don't care about inlining "purity". Rather than attempting to "fix" code which isn't really broken, I chose to disable an unhelpful warning. Signed-off-by: Richard W.M. Jones --- acinclude.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 31988b1d4..68e850ec4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2,7 +2,7 @@ dnl dnl Taken from libvirt/acinclude.m4 dnl dnl We've added: -dnl -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls +dnl -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wredundant-decls dnl We've removed dnl CFLAGS="$realsave_CFLAGS" dnl to avoid clobbering user-specified CFLAGS @@ -34,7 +34,7 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[ maximum|error) try_compiler_flags="-Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith" try_compiler_flags="$try_compiler_flags -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return" - try_compiler_flags="$try_compiler_flags -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare" + try_compiler_flags="$try_compiler_flags -Wstrict-prototypes -Wredundant-decls -Wno-sign-compare" try_compiler_flags="$try_compiler_flags $common_flags" if test "$enable_compile_warnings" = "error" ; then try_compiler_flags="$try_compiler_flags -Werror"