[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Diffutils-devel] build: ensure no VLA is used
From: |
Jim Meyering |
Subject: |
[Diffutils-devel] build: ensure no VLA is used |
Date: |
Mon, 21 Jan 2019 16:49:27 -0800 |
I'm pushing these to prevent use of VLAs:
>From 0c8f1ff314cfa132fe2c1cf42b154c8e1e6397c9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 20 Jan 2019 22:24:30 -0800
Subject: [PATCH 1/2] build: update gnulib to latest
* gnulib: Update to latest.
* po/POTFILES.in: Add lib/xstdopen.c.
---
gnulib | 2 +-
po/POTFILES.in | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/gnulib b/gnulib
index 8089c00..5b490ef 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 8089c00979a5b089cff592c6b91420e595657167
+Subproject commit 5b490ef07f257a5dd41fc0b351c1a387b8a8f89c
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1897705..5bcd8ec 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -24,6 +24,7 @@ lib/quotearg.c
lib/regcomp.c
lib/xalloc-die.c
lib/xfreopen.c
+lib/xstdopen.c
lib/xstrtol-error.c
lib/version-etc.c
--
2.20.1.2.gb21ebb671b
>From 3600e8d4f07a4dc2a62f015168e2da5a47c4f96f Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 20 Jan 2019 22:24:59 -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 1c8f0eb..9c2698c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,10 @@ gl_EARLY
gl_USE_SYSTEM_EXTENSIONS
gl_INIT
+# 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])
+
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings (for developers)])],
@@ -78,7 +82,6 @@ if test "$gl_gcc_warnings" = yes; then
nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
nw="$nw -Wlogical-op" # any use of fwrite provokes this
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
--
2.20.1.2.gb21ebb671b
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Diffutils-devel] build: ensure no VLA is used,
Jim Meyering <=