]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
gettext.h: Update from gnulib.
authorBruno Haible <bruno@clisp.org>
Sun, 5 Jul 2020 20:06:43 +0000 (22:06 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 5 Jul 2020 20:06:43 +0000 (22:06 +0200)
* gnulib-local/lib/gettext.h: Disable use of VLAs if GNULIB_NO_VLA is defined.

gnulib-local/lib/gettext.h

index 928e6ee9be34a0f635fcfdbb8ec4e6fa05601a60..b40ef82bdd6b1e872b4dafbc91f401c008945106 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2018 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2020 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -184,9 +184,16 @@ npgettext_aux (const char *domain,
 
 #include <string.h>
 
-#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-     /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
-        || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )
+/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported.
+   This relates to the -Wvla and -Wvla-larger-than warnings, enabled in
+   the default GCC many warnings set.  This allows programs to disable use
+   of VLAs, which may be unintended, or may be awkward to support portably,
+   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__) */ ))
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
 #else
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0