From: Paul Eggert Date: Sat, 27 Nov 2021 08:33:24 +0000 (-0800) Subject: gettext-h: use VLA test similar to regex X-Git-Tag: v1.0~2548 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=914fe7e1a241dc10f333eff181175266e05bf972;p=gnulib.git 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__. --- diff --git a/ChangeLog b/ChangeLog index d2e7cc596c..66c53a923b 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 f1c7a24075..01d9c1cf6b 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 72bdcb284d..a0036d09c4 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])