From 93d6b015747f5fc4592f22535579480b8828461c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 27 Nov 2021 00:49:56 -0800 Subject: [PATCH 3/3] gettext-h: document GNULIB_NO_VLA * doc/gnulib-readme.texi (C99 features avoided): Document GNULIB_NO_VLA. --- ChangeLog | 4 ++++ doc/gnulib-readme.texi | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66c53a923..efc289fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-11-27 Paul Eggert + gettext-h: document GNULIB_NO_VLA + * doc/gnulib-readme.texi (C99 features avoided): + Document GNULIB_NO_VLA. + gettext-h: use VLA test similar to regex * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Assuming GNULIB_NO_VLA, define if (defined __STDC_VERSION__ && 199901L <= diff --git a/doc/gnulib-readme.texi b/doc/gnulib-readme.texi index 0a32f980c..9f9e1c1ce 100644 --- a/doc/gnulib-readme.texi +++ b/doc/gnulib-readme.texi @@ -402,8 +402,19 @@ feature should require the corresponding module. @itemize @item -Variable length arrays, unless @code{__STDC_NO_VLA__} is defined. -See the @code{vararrays} module. +Variable length arrays (VLAs) or variably modified types, +without checking whether @code{__STDC_NO_VLA__} is defined. +See the @code{vararrays} and @code{vla} modules. + +@item +Block-scope variable length arrays, without checking whether either +@code{GNULIB_NO_VLA} or @code{__STDC_NO_VLA__} is defined. +This lets you define @code{GNULIB_NO_VLA} to pacify GCC when +using its @option{-Wvla-larger-than warnings} option, +and to avoid large stack usage that may have security implications. +@code{GNULIB_NO_VLA} does not affect Gnulib's other uses of VLAs and +variably modified types, such as array declarations in function +prototype scope. @item @code{extern inline} functions, without checking whether they are -- 2.32.0