[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
build: ensure no VLA is used
From: |
Jim Meyering |
Subject: |
build: ensure no VLA is used |
Date: |
Mon, 21 Jan 2019 16:48:51 -0800 |
I'm pushing these to prevent use of VLAs:
>From c728a3fcb14e2e332e7f42c62f0ce710f858f0fe Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 20 Jan 2019 22:22:31 -0800
Subject: [PATCH 1/2] build: update gnulib to latest
---
gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gnulib b/gnulib
index e663365..5b490ef 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit e6633650a245a4e5bfe2e3de92be93a623eef7a9
+Subproject commit 5b490ef07f257a5dd41fc0b351c1a387b8a8f89c
--
2.20.1.2.gb21ebb671b
>From 2a7125a8b37abf4e6880242c03d0be02f9c0a98d Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 20 Jan 2019 22:22:03 -0800
Subject: [PATCH 2/2] build: ensure no VLA is used
Cause developer builds to fail for any use of a VLA.
VLAs (variable length arrays) limit portability.
* configure.ac (nw): Remove -Wvla from the list of disabled warnings,
thus enabling the warning when configured with --enable-gcc-warnings.
(GNULIB_NO_VLA) Define, disabling use of VLAs in gnulib. This commit
is functionally equivalent to coreutils' v8.30-44-gd26dece5d.
---
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 8145690..186570d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,10 @@ gl_EARLY
gl_INIT
gl_DISABLE_THREADS
+# 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])
+
# The test suite needs to know if we have a working perl.
# FIXME: this is suboptimal. Ideally, we would be able to call gl_PERL
# with an ACTION-IF-NOT-FOUND argument ...
@@ -242,7 +246,6 @@ if test "$gl_gcc_warnings" = yes; then
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
- nw="$nw -Wvla" # warnings in gettext.h
nw="$nw -Wswitch-default" # Too many warnings for now
gl_MANYWARN_ALL_GCC([ws])
--
2.20.1.2.gb21ebb671b
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- build: ensure no VLA is used,
Jim Meyering <=