]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add -Wall and -Wextra explicitly
authorPavel Hrdina <phrdina@redhat.com>
Tue, 1 Sep 2020 12:54:27 +0000 (14:54 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 3 Sep 2020 12:47:09 +0000 (14:47 +0200)
If someone runs `meson setup --buildtype plain` meson ignores
warning_level=2 that is in our meson.build file. The implication is
that Meson will not automatically add -Wall which enables -Wformat.

This breaks building libvirt from git with the buildtype set to plain.

There is an issue reported [1] to not ignore warning_level silently
and the change to ignore it was done by upstream commit [2].

This change makes Meson print warnings about using warning_level which
as described above doesn't work for all build types.

[1] <https://github.com/mesonbuild/meson/issues/7399>
[2] <https://github.com/mesonbuild/meson/commit/8ee1c9a07a3a35e3ed262fbc358fd86c257a966e>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
meson.build

index 1aad385ad1aab85d2914273a77b94dfa88edcf6d..1eadea33bf8758d0ae4c05b331f89663369f8264 100644 (file)
@@ -228,6 +228,7 @@ cc_flags += [
   '-Waddress',
   '-Waddress-of-packed-member',
   '-Waggressive-loop-optimizations',
+  '-Wall',
   '-Wattribute-warning',
   '-Wattributes',
   '-Wbool-compare',
@@ -257,6 +258,7 @@ cc_flags += [
   '-Wempty-body',
   '-Wendif-labels',
   '-Wexpansion-to-defined',
+  '-Wextra',
   '-Wformat-contains-nul',
   '-Wformat-extra-args',
   '-Wformat-nonliteral',
@@ -503,10 +505,6 @@ cc_flags_disabled = [
   # In meson this is specified using 'c_std=gnu99' in project() function.
   '-std=gnu99',
 
-  # In meson this is specified using 'warning_level=2' in project() function.
-  '-Wall',
-  '-Wextra',
-
   # don't care about C++ compiler compat
   '-Wc++-compat',
   '-Wabi',