[PATCH] meson.build: Fix the -Wvla-larger-than flag

Thomas Huth posted 1 patch 2 years, 11 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210525160247.179571-1-thuth@redhat.com
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] meson.build: Fix the -Wvla-larger-than flag
Posted by Thomas Huth 2 years, 11 months ago
It's "...-than=..." and not "...-then=...".

Fixes: 8dd259d0c6 ("meson: add manywarnings")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 4f23f9104e..8ee0416700 100644
--- a/meson.build
+++ b/meson.build
@@ -390,7 +390,7 @@ cc_flags += [
   '-Wvariadic-macros',
   '-Wvector-operation-performance',
   '-Wvla',
-  '-Wvla-larger-then=4031',
+  '-Wvla-larger-than=4031',
   '-Wvolatile-register-var',
   '-Wwrite-strings',
 ]
-- 
2.27.0

Re: [PATCH] meson.build: Fix the -Wvla-larger-than flag
Posted by Daniel P. Berrangé 2 years, 11 months ago
On Tue, May 25, 2021 at 06:02:47PM +0200, Thomas Huth wrote:
> It's "...-than=..." and not "...-then=...".
> 
> Fixes: 8dd259d0c6 ("meson: add manywarnings")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 4f23f9104e..8ee0416700 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -390,7 +390,7 @@ cc_flags += [
>    '-Wvariadic-macros',
>    '-Wvector-operation-performance',
>    '-Wvla',
> -  '-Wvla-larger-then=4031',
> +  '-Wvla-larger-than=4031',

IIUC,  -Wvla-larger-than=NNN weakens the check done by -Wvla such that
it only complains about a subset of vlas that are unbounded or larger
than the noted size.

Given that we had this typo, we were only ever using -Wvla. Since we
compile without warnings, we evidentally don't have any vlas that
trigger with -Wvla at all.

So by that rationale I think -Wvla-larger-than=NNN is redundant and
can be removed entirely


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|