GNU bug report logs - #34167
build: ensure no VLA is used

Previous Next

Package: gzip;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Tue, 22 Jan 2019 00:50:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34167 in the body.
You can then email your comments to 34167 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gzip <at> gnu.org:
bug#34167; Package gzip. (Tue, 22 Jan 2019 00:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Meyering <jim <at> meyering.net>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Tue, 22 Jan 2019 00:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: bug-gzip <at> gnu.org
Subject: build: ensure no VLA is used
Date: Mon, 21 Jan 2019 16:49:42 -0800
[Message part 1 (text/plain, inline)]
I'm pushing these to prevent use of VLAs:

[vla.txt (text/plain, inline)]
From 8aa53f1797315a541960d4225f00c9f27c9612fe Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> fb.com>
Date: Sun, 20 Jan 2019 22:23:57 -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 4652c7b..5b490ef 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 4652c7bafa60332145f1e05a7de5f48e1bc56226
+Subproject commit 5b490ef07f257a5dd41fc0b351c1a387b8a8f89c
-- 
2.20.1.2.gb21ebb671b


From 20540be6186c159880dda3a49a5827722c1a0ac9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> fb.com>
Date: Sun, 20 Jan 2019 22:24:06 -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 db86a2a..9a2b635 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,10 @@ gl_EARLY

 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 many GCC warnings (for developers; best with GNU make)])],
@@ -114,7 +118,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


bug closed, send any further explanations to 34167 <at> debbugs.gnu.org and Jim Meyering <jim <at> meyering.net> Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Tue, 22 Jan 2019 01:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Feb 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.