]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: ensure VLAs are not used
authorPádraig Brady <P@draigBrady.com>
Mon, 14 Jan 2019 06:11:11 +0000 (22:11 -0800)
committerPádraig Brady <P@draigBrady.com>
Sun, 20 Jan 2019 05:15:01 +0000 (21:15 -0800)
Fail developer builds if VLAs are used,
as there are portability concerns to consider with them.

* configure.ac: Enable -Wvla which is implicit in the full list added.
* m4/jm-macros.m4: Define GNULIB_NO_VLA which disables use of
VLAs within gnulib code.

configure.ac
m4/jm-macros.m4

index 13bb167b0de2cd6a45ad35def45cb5fee9f6bf4d..23086cd640594c6022fcfe0e3ba6fe9401c1b899 100644 (file)
@@ -130,7 +130,6 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wredundant-decls"        # openat.h declares e.g., mkdirat
   nw="$nw -Wlogical-op"             # Too many warnings until GCC 4.8.0
   nw="$nw -Wformat-nonliteral"      # who.c and pinky.c strftime uses
-  nw="$nw -Wvla"                    # warnings in gettext.h
   nw="$nw -Wnested-externs"         # use of XARGMATCH/verify_function__
   nw="$nw -Wswitch-enum"            # Too many warnings for now
   nw="$nw -Wswitch-default"         # Too many warnings for now
index 39191de278aff5fd217ad9984c98ade98bea9ae0..3374137e078b4c3f34db2e17922f37b5ecf0e302 100644 (file)
@@ -41,6 +41,10 @@ AC_DEFUN([coreutils_MACROS],
   AC_DEFINE([ARGMATCH_DIE_DECL], [void usage (int _e)],
             [Define to the declaration of the xargmatch failure function.])
 
+  # Ensure VLAs are not used.
+  # Note -Wvla is implicitly added by gl_MANYWARN_ALL_GCC
+  AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs])
+
   # used by shred
   AC_CHECK_FUNCS_ONCE([directio])