From e847bcca0cde35e4b15dad70150a943f7d78fdd5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 13 Feb 2026 17:37:50 -0800 Subject: [PATCH] Remove vla.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses of ’s macro VLA_ELEMS were removed some time ago. * admin/merge-gnulib (GNULIB_MODULES): Remove vla. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/vla.h: Remove. * src/fns.c, src/lread.c: Do not include . --- admin/merge-gnulib | 2 +- lib/gnulib.mk.in | 10 --------- lib/vla.h | 53 ---------------------------------------------- m4/gnulib-comp.m4 | 2 -- src/fns.c | 1 - src/lread.c | 1 - 6 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 lib/vla.h diff --git a/admin/merge-gnulib b/admin/merge-gnulib index c64c9647d11..833d2b73a41 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -52,7 +52,7 @@ GNULIB_MODULES=' stpcpy stringeq strnlen strtoimax symlink sys_stat-h sys_time-h tempname time-h time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimensat - vla warnings year2038 + warnings year2038 ' AVOIDED_MODULES=' diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 33d8d5ad367..a5154c074f6 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -187,7 +187,6 @@ # unlocked-io \ # update-copyright \ # utimensat \ -# vla \ # warnings \ # year2038 @@ -4533,15 +4532,6 @@ EXTRA_DIST += verify.h endif ## end gnulib module verify -## begin gnulib module vla -ifeq (,$(OMIT_GNULIB_MODULE_vla)) - - -EXTRA_DIST += vla.h - -endif -## end gnulib module vla - mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ diff --git a/lib/vla.h b/lib/vla.h deleted file mode 100644 index 5c893dbb4c1..00000000000 --- a/lib/vla.h +++ /dev/null @@ -1,53 +0,0 @@ -/* vla.h - variable length arrays - - Copyright 2014-2026 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - Written by Paul Eggert. */ - -/* The VLA_ELEMS macro does not allocate variable-length arrays (VLAs), - so it does not have the security or performance issues commonly - associated with VLAs. VLA_ELEMS is for exploiting a C11 feature - where a function can start like this: - - double scan_array (int n, double v[static n]) - - to require a caller to pass a vector V with at least N elements; - this allows better static checking and performance in some cases. - In C11 this feature means that V is a VLA, so the feature is - supported only if __STDC_NO_VLA__ is defined, and for compatibility - to platforms that do not support VLAs, VLA_ELEMS (n) expands to - nothing when __STDC_NO_VLA__ is not defined. */ - -/* A function's argument must point to an array with at least N elements. - Example: 'int main (int argc, char *argv[VLA_ELEMS (argc)]);'. */ - -#ifdef __STDC_NO_VLA__ -# define VLA_ELEMS(n) -#else -# define VLA_ELEMS(n) static n -#endif - -/* Although C99 requires support for variable-length arrays (VLAs), - some C compilers never supported VLAs and VLAs are optional in C11. - VLAs are controversial because their allocation may be unintended - or awkward to support, and large VLAs might cause security or - performance problems. GCC can diagnose the use of VLAs via the - -Wvla and -Wvla-larger-than warnings options, and defining the - macro GNULIB_NO_VLA disables the allocation of VLAs in Gnulib code. - - The VLA_ELEMS macro is unaffected by GNULIB_NO_VLA, since it does - not allocate VLAs. Programs that use VLA_ELEMS should be compiled - with 'gcc -Wvla-larger-than' instead of with 'gcc -Wvla'. */ diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index f2e09dd0d27..5e5906949de 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -225,7 +225,6 @@ AC_DEFUN([gl_EARLY], # Code from module utimensat: # Code from module vararrays: # Code from module verify: - # Code from module vla: # Code from module warnings: # Code from module year2038: AC_REQUIRE([AC_SYS_YEAR2038]) @@ -1507,7 +1506,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/utimens.h lib/utimensat.c lib/verify.h - lib/vla.h lib/warn-on-use.h m4/00gnulib.m4 m4/__inline.m4 diff --git a/src/fns.c b/src/fns.c index c29f9fa8cd1..71f3f01a91d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -24,7 +24,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include diff --git a/src/lread.c b/src/lread.c index 9d91ac8909d..219d64d0282 100644 --- a/src/lread.c +++ b/src/lread.c @@ -45,7 +45,6 @@ along with GNU Emacs. If not, see . */ #include "blockinput.h" #include "pdumper.h" #include -#include #ifdef MSDOS #include "msdos.h"