Skip to content

Commit

Permalink
acinclude.m4: Disable -Winline warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rwmjones committed Aug 6, 2024
1 parent e82136a commit a685bc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a685bc1

Please sign in to comment.