]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
buildsys: warn on usage of VLAs
authorThomas Weißschuh <thomas@t-8ch.de>
Tue, 12 Sep 2023 21:49:21 +0000 (23:49 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 13 Sep 2023 06:37:02 +0000 (08:37 +0200)
Variable-length-arrays are susceptible to security issues, ensure none
are introduced.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
configure.ac
meson.build

index 5f609dec74c90842b502fe97b08a75132357d09e..4e8a407b8e56331aed57ebfe5dc0271286570acc 100644 (file)
@@ -156,6 +156,7 @@ UL_WARN_ADD([-Wunused-but-set-variable])
 UL_WARN_ADD([-Wunused-parameter])
 UL_WARN_ADD([-Wunused-result])
 UL_WARN_ADD([-Wunused-variable])
+UL_WARN_ADD([-Wvla])
 
 AC_ARG_ENABLE([werror],
   AS_HELP_STRING([--enable-werror], [make all compiler warnings into errors]),
index 8e3d6bb1d93dfc42afc4e1514bbd5b2a9fdeb630..c00844a3bd1fd70608618810dcafa24fe690d26a 100644 (file)
@@ -876,6 +876,7 @@ compiler_flags = [
   '-Wunused-parameter',
   '-Wunused-result',
   '-Wunused-variable',
+  '-Wvla',
 ]
 foreach compiler_flag : compiler_flags
   if cc.has_argument(compiler_flag)