From: Marc-André Lureau Date: Sun, 16 Mar 2025 08:18:22 +0000 (+0400) Subject: build-sys: drop -Winline when optimization=g X-Git-Tag: v11.2.0-rc1~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7253dda5178e0504a4f3ba859c96883aca6bec7d;p=thirdparty%2Flibvirt.git build-sys: drop -Winline when optimization=g The warning is triggered when compiling with various build options, such as -Doptimization=g. From gcc(1) man page about -Winline: seemingly insignificant changes in the source program can cause the warnings produced by -Winline to appear or disappear. Such flaky behaviour is best left to the user discretion. Signed-off-by: Marc-André Lureau Reviewed-by: Martin Kletzander --- diff --git a/meson.build b/meson.build index 2d76a0846c..56823ca25b 100644 --- a/meson.build +++ b/meson.build @@ -340,7 +340,6 @@ cc_flags += [ '-Wimplicit-int', '-Wincompatible-pointer-types', '-Winit-self', - '-Winline', '-Wint-conversion', '-Wint-in-bool-context', '-Wint-to-pointer-cast', @@ -444,6 +443,12 @@ cc_flags += [ '-Wwrite-strings', ] +if get_option('optimization') != 'g' + # Seemingly insignificant changes in the source program can cause the warnings + # produced by -Winline to appear or disappear. + cc_flags += [ '-Winline' ] +endif + if cc.get_id() == 'clang' # Stop CLang from doing inter-procedural analysis of calls # between functions in the same compilation unit. Such an