From 129b464c24f9331af1d3671f5c34a1fe031282ab Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 4 Mar 2021 15:37:26 +0000 Subject: [PATCH] build: Warn about VLA usage Using consts for array sizes is a C++-ism, and in GCC in C-mode it won't fold literal constants, and will instead prefer to make a VLA. Signed-off-by: Joshua Ashton --- meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meson.build b/meson.build index b3a46715..484c0c19 100644 --- a/meson.build +++ b/meson.build @@ -97,6 +97,9 @@ endif add_project_arguments(vkd3d_compiler.get_supported_arguments([ '-fvisibility=hidden', + # For some reason, the use of VLAs isn't in all+extra+pedantic + # We don't want to use these accidentally from consts... + '-Wvla', '-Wno-format', '-Wno-missing-field-initializers', '-Wno-unused-parameter',