diff mbox series

[RFC,4/4] buildsys: Prohibit alloca() use on system code

Message ID 20250605193540.59874-5-philmd@linaro.org
State New
Headers show
Series system: Forbid alloca() | expand

Commit Message

Philippe Mathieu-Daudé June 5, 2025, 7:35 p.m. UTC
Similarly to commit 64c1a544352 ("meson: Enable -Wvla") with
variable length arrays, forbid alloca() uses on system code.

There are few uses on ancient linux-user code, do not bother
there.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 meson.build | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index ef994676fe9..8c6ccb03c71 100644
--- a/meson.build
+++ b/meson.build
@@ -774,6 +774,10 @@  if host_os != 'darwin'
   endif
 endif
 
+if have_system
+  warn_flags += ['-Walloca']
+endif
+
 # Set up C++ compiler flags
 qemu_cxxflags = []
 if 'cpp' in all_languages