Bruno Haible <[EMAIL PROTECTED]> writes: > - I don't want to rely on __STDC_VERSION__ for the reasons explained in > http://lists.gnu.org/archive/html/bug-gnulib/2006-10/msg00354.html,
But this case is different. Here, __STDC_VERSION__ is inspected only if GCC 3 or later, so __STDC_VERSION__ >= 199901L should reliably indicate whether variable size arrays are supported. > - Why would it be useful to use variable size arrays if > (__STDC_VERSION__ >= 199901L && __STRICT_ANSI__) ? For efficiency when compiled by "gcc -std=c99". > The gcc manual documents that __STRICT_ANSI__ stands for strict ISO C90; > this looks like a gcc bug to me: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29994 > Until they document it properly, I prefer to ignore this case. I just now checked that URL, and apparently it was documented properly after all, just in a different place. So, how about this patch? Admittedly it's not a huge point, since gcc -std=c99 is fairly rare, but it's nice to have this patch if only for accurate internal documentation. 2006-11-27 Paul Eggert <[EMAIL PROTECTED]> * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): If GCC 3 or later, define if __STDC_VERSION__ >= 199901L, as GCC supports variable size arrays in this case even when __STRICT_ANSI__ is defined. *** lib/gettext.h 27 Nov 2006 14:17:38 -0000 1.14 --- lib/gettext.h 27 Nov 2006 20:34:16 -0000 *************** *** 169,175 **** #include <string.h> #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ ! (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS --- 169,176 ---- #include <string.h> #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ ! (((__GNUC__ >= 3 || __GNUG__ >= 2) \ ! && (__STDC_VERSION__ >= 199901L || ! __STRICT_ANSI__)) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS