bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposed patch to gettext.h for gcc -ansi -pedantic


From: Paul Eggert
Subject: proposed patch to gettext.h for gcc -ansi -pedantic
Date: Sun, 26 Nov 2006 23:20:10 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

gettext.h also has a problem with gcc -ansi -pedantic: it uses the
[restrict] syntax in that case, but GCC complains about it since
[restrict] isn't in C89.  Here's a proposed patch:

2006-11-26  Paul Eggert  <address@hidden>

        * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS):
        Don't define if __STRICT_ANSI__, unless it's C99 or later,
        since C89 lacked support for the [restrict] syntax and
        gcc -ansi -pedantic complains about it.

Index: lib/gettext.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/gettext.h,v
retrieving revision 1.13
diff -p -u -r1.13 gettext.h
--- lib/gettext.h       10 Nov 2006 14:49:09 -0000      1.13
+++ lib/gettext.h       27 Nov 2006 07:17:01 -0000
@@ -169,7 +169,9 @@ npgettext_aux (const char *domain,
 #include <string.h>
 
 #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (__GNUC__ >= 3 || __GNUG__ >= 2 /* || __STDC_VERSION__ >= 199901L */ )
+  (((__GNUC__ >= 3 || __GNUG__ >= 2) \
+    && (__STDC_VERSION__ >= 199901L || ! __STRICT_ANSI__)) \
+   /* || __STDC_VERSION__ >= 199901L */)
 
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 #include <stdlib.h>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]