[PATCH 16/16] build: enable vla warnings on Windows built code
Tyler Retzlaff
roretzla at linux.microsoft.com
Thu Apr 18 01:41:59 CEST 2024
MSVC does not support optional C11 VLAs. When building for Windows
enable -Wvla so that mingw and clang also fail if a VLA is used.
Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
config/meson.build | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/config/meson.build b/config/meson.build
index 8c8b019..9e887f2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -344,6 +344,10 @@ if cc.get_id() == 'intel'
warning_flags += '-diag-disable=@0@'.format(i)
endforeach
endif
+# no VLAs in code built on Windows
+if is_windows
+ warning_flags += '-Wvla'
+endif
foreach arg: warning_flags
if cc.has_argument(arg)
add_project_arguments(arg, language: 'c')
--
1.8.3.1
More information about the dev
mailing list