summaryrefslogtreecommitdiff
path: root/gl/lib/gettext.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/lib/gettext.h')
-rw-r--r--gl/lib/gettext.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/gl/lib/gettext.h b/gl/lib/gettext.h
index 89f53d91..c7c0fdb5 100644
--- a/gl/lib/gettext.h
+++ b/gl/lib/gettext.h
@@ -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