[libvirt PATCH] meson: add -Wformat explicitly

Pavel Hrdina posted 1 patch 3 years, 7 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/ba571c0833e56f0d1b0ee02e00efa26bf08db2d6.1598966966.git.phrdina@redhat.com
meson.build | 1 +
1 file changed, 1 insertion(+)
[libvirt PATCH] meson: add -Wformat explicitly
Posted by Pavel Hrdina 3 years, 7 months ago
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].

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index e193166a9b..4e99b5ba39 100644
--- a/meson.build
+++ b/meson.build
@@ -257,6 +257,7 @@ cc_flags += [
   '-Wempty-body',
   '-Wendif-labels',
   '-Wexpansion-to-defined',
+  '-Wformat',
   '-Wformat-contains-nul',
   '-Wformat-extra-args',
   '-Wformat-nonliteral',
-- 
2.26.2

Re: [libvirt PATCH] meson: add -Wformat explicitly
Posted by Michal Privoznik 3 years, 7 months ago
On 9/1/20 3:30 PM, Pavel Hrdina wrote:
> 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].
> 
> [1] <https://github.com/mesonbuild/meson/issues/7399>
> [2] <https://github.com/mesonbuild/meson/commit/8ee1c9a07a3a35e3ed262fbc358fd86c257a966e>
> 
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>   meson.build | 1 +
>   1 file changed, 1 insertion(+)
> 
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

Re: [libvirt PATCH] meson: add -Wformat explicitly
Posted by Ján Tomko 3 years, 7 months ago
On a Tuesday in 2020, Pavel Hrdina wrote:
>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].
>
>[1] <https://github.com/mesonbuild/meson/issues/7399>
>[2] <https://github.com/mesonbuild/meson/commit/8ee1c9a07a3a35e3ed262fbc358fd86c257a966e>
>
>Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>---
> meson.build | 1 +
> 1 file changed, 1 insertion(+)
>

NACK, this is missing all the other -Wall flags.

Jano

>diff --git a/meson.build b/meson.build
>index e193166a9b..4e99b5ba39 100644
>--- a/meson.build
>+++ b/meson.build
>@@ -257,6 +257,7 @@ cc_flags += [
>   '-Wempty-body',
>   '-Wendif-labels',
>   '-Wexpansion-to-defined',
>+  '-Wformat',
>   '-Wformat-contains-nul',
>   '-Wformat-extra-args',
>   '-Wformat-nonliteral',
>-- 
>2.26.2
>