[PATCH v17 25/25] config: add -Wvla project-wide

Andre Muezerie andremue at linux.microsoft.com
Thu Jan 30 15:32:41 CET 2025


Add -Wvla project-wide so that VLAs are not allowed by default. This
is to avoid new VLAs from being introduced.

Meson files in directories which are not yet VLA-free have already
been updated with -Wno-vla to avoid build breaks.

Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
---
 config/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/meson.build b/config/meson.build
index 6be928e04b..78f79b9a4d 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -345,6 +345,7 @@ endif
 
 no_vla_cflag = []
 if cc.has_argument('-Wvla')
+    add_project_arguments('-Wvla', language: 'c')
     if not is_windows
         no_vla_cflag = '-Wno-vla'
     endif
-- 
2.47.2.vfs.0.1



More information about the dev mailing list