[v7,18/21] build: enable vla warnings on Windows built code
Checks
Commit Message
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
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@linux.microsoft.com>
---
config/meson.build | 4 ++++
1 file changed, 4 insertions(+)
@@ -342,6 +342,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')