[PATCH] meson.build: Compile with -Walloca

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/20210527104554.351489-1-thuth@redhat.com
meson.build | 1 +
1 file changed, 1 insertion(+)
[PATCH] meson.build: Compile with -Walloca
Posted by Thomas Huth 2 years, 11 months ago
We are already compiling libvirt with -Wvla - so it does not make
too much sense to still allow people to use alloca() instead. Thus
put it on the list of things we want to warn about. Fortunately,
there is currently no warning with this flag, so the current
sources should be clean.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index 40c841e777..a97efdf8f4 100644
--- a/meson.build
+++ b/meson.build
@@ -234,6 +234,7 @@ cc_flags += [
   '-Waddress-of-packed-member',
   '-Waggressive-loop-optimizations',
   '-Walloc-size-larger-than=@0@'.format(alloc_max.stdout().strip()),
+  '-Walloca',
   '-Warray-bounds=2',
   '-Wattribute-alias=2',
   '-Wattribute-warning',
-- 
2.27.0

Re: [PATCH] meson.build: Compile with -Walloca
Posted by Ján Tomko 2 years, 11 months ago
On a Thursday in 2021, Thomas Huth wrote:
>We are already compiling libvirt with -Wvla - so it does not make
>too much sense to still allow people to use alloca() instead. Thus
>put it on the list of things we want to warn about. Fortunately,
>there is currently no warning with this flag, so the current
>sources should be clean.
>
>Signed-off-by: Thomas Huth <thuth@redhat.com>
>---
> meson.build | 1 +
> 1 file changed, 1 insertion(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

A pipeline with this and your other warning patch:
https://gitlab.com/janotomko/libvirt/-/pipelines/310576595

(I'll push it after the release)

Jano
Re: [PATCH] meson.build: Compile with -Walloca
Posted by Jano Tomko 2 years, 10 months ago

On 5/27/21 1:30 PM, Ján Tomko wrote:
> On a Thursday in 2021, Thomas Huth wrote:
>> We are already compiling libvirt with -Wvla - so it does not make
>> too much sense to still allow people to use alloca() instead. Thus
>> put it on the list of things we want to warn about. Fortunately,
>> there is currently no warning with this flag, so the current
>> sources should be clean.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> meson.build | 1 +
>> 1 file changed, 1 insertion(+)
>>
> 
> Reviewed-by: Ján Tomko <jtomko@redhat.com>
> 
> A pipeline with this and your other warning patch:
> https://gitlab.com/janotomko/libvirt/-/pipelines/310576595
> 
> (I'll push it after the release)
> 

Now pushed. (which is technically after the release, as I promised :)

Jano

> Jano