]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build-sys: drop -Winline when optimization=g
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Sun, 16 Mar 2025 08:18:22 +0000 (12:18 +0400)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 18 Mar 2025 13:15:55 +0000 (14:15 +0100)
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 <marcandre.lureau@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
meson.build

index 2d76a0846c6b94f8d168d25f09dd60954db770cb..56823ca25b76fcf87fcf53f1f1ae9ce7491a6628 100644 (file)
@@ -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