]> Savannah Git Hosting - gnulib.git/commitdiff
gettext-h: use VLA test similar to regex
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Nov 2021 08:33:24 +0000 (00:33 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Nov 2021 08:51:22 +0000 (00:51 -0800)
* 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
lib/gettext.h
modules/gettext-h

index d2e7cc596c5516e441fdd4f6e9b0500a53c1b65d..66c53a923b4ffae779d495f4fc91427ab806350e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2021-11-27  Paul Eggert  <eggert@cs.ucla.edu>
 
+       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
index f1c7a240757ef92bf69753fb31aeb705746bf292..01d9c1cf6bc53f3b6b51cba17a23bbf3ad46bbce 100644 (file)
@@ -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
index 72bdcb284d2c2e2409bfaab5309cc7e3a6d9e5c2..a0036d09c4c2858946cb2e5403004369e427301c 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/gettext.h
 
 Depends-on:
+vararrays
 
 configure.ac:
 AC_SUBST([LIBINTL])