From 5750a04d7ae9fd637864092b6eb1153a225d0e36 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 27 Nov 2021 00:33:24 -0800 Subject: [PATCH 2/3] 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 <= __STDC_VERSION__ \ + && !defined __STDC_NO_VLA___), not if ((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__). This is more consistent with what the regex module does. * modules/gettext-h (Depends-on): Depend on vararrays, since lib/gettext.h uses __STDC_NO_VLA__. --- ChangeLog | 9 +++++++++ lib/gettext.h | 5 ++--- modules/gettext-h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2e7cc596..66c53a923 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2021-11-27 Paul Eggert + 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 <= + __STDC_VERSION__ \ + && !defined __STDC_NO_VLA___), not if + ((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__). + This is more consistent with what the regex module does. + * modules/gettext-h (Depends-on): Depend on vararrays, since + lib/gettext.h uses __STDC_NO_VLA__. + regex: port to tcc Problem reported by Benno Schulenberg in: https://lists.gnu.org/r/bug-gnulib/2021-11/msg00038.html diff --git a/lib/gettext.h b/lib/gettext.h index f1c7a2407..01d9c1cf6 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -191,9 +191,8 @@ npgettext_aux (const char *domain, or may have security implications due to non-deterministic stack usage. */ #if (!defined GNULIB_NO_VLA \ - && (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) - || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )) + && defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ \ + && !defined __STDC_NO_VLA__) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 diff --git a/modules/gettext-h b/modules/gettext-h index 72bdcb284..a0036d09c 100644 --- a/modules/gettext-h +++ b/modules/gettext-h @@ -5,6 +5,7 @@ Files: lib/gettext.h Depends-on: +vararrays configure.ac: AC_SUBST([LIBINTL]) -- 2.32.0