[PATCH v16 59/60] app: add compile warning about use of VLAs
Andre Muezerie
andremue at linux.microsoft.com
Tue Jan 14 03:32:37 CET 2025
MSVC does not support VLAs, so we want to prevent VLAs from being
introduced under this path.
Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
---
app/meson.build | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/meson.build b/app/meson.build
index e2db888ae1..894d126dde 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -45,6 +45,15 @@ if get_option('tests')
endif
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
+
+extra_flags = ['-Wvla']
+
+foreach arg: extra_flags
+ if cc.has_argument(arg)
+ default_cflags += arg
+ endif
+endforeach
+
default_ldflags = []
if get_option('default_library') == 'static' and not is_windows
default_ldflags += ['-Wl,--export-dynamic']
--
2.47.0.vfs.0.3
More information about the dev
mailing list