[v3,19/19] build: enable vla warnings on Windows built code

Message ID 1715019531-22796-20-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Series remove use of VLAs for Windows |


Context Check Description
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/github-robot: build fail github build: failed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Tyler Retzlaff May 6, 2024, 6:18 p.m. UTC
  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(+)


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)
+# no VLAs in code built on Windows
+if is_windows
+    warning_flags += '-Wvla'
 foreach arg: warning_flags
     if cc.has_argument(arg)
         add_project_arguments(arg, language: 'c')