bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] xalloc.h gcc -Wundef fix


From: Simon Josefsson
Subject: [Bug-gnulib] xalloc.h gcc -Wundef fix
Date: Thu, 28 Aug 2003 08:17:45 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Perhaps too much of nit'picking, but I'm somtimes using -Wundef and
xalloc.h complains about __STRICT_ANSI__.  The same probably applies
to __GNUC__ too, but as I'm using gcc it is already defined.

Has someone studied which gcc warnings really are important for
portability?  Any preferences for gnulib code?

../gl/xalloc.h:26:64: warning: "__STRICT_ANSI__" is not defined

2003-08-28  Simon Josefsson  <address@hidden>

        * xalloc.h: Check if __GNUC__ and __STRICT_ANSI__ are defined
        before using them.

Index: lib/xalloc.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xalloc.h,v
retrieving revision 1.16
diff -u -p -r1.16 xalloc.h
--- lib/xalloc.h        22 Jul 2003 22:10:56 -0000      1.16
+++ lib/xalloc.h        28 Aug 2003 06:14:21 -0000
@@ -23,7 +23,9 @@
 # include <stddef.h>
  
 # ifndef __attribute__
-#  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
+#  if (defined(__GNUC__) && (__GNUC__ < 2 ||                           \
+                            (__GNUC__ == 2 && __GNUC_MINOR__ < 8))) || \
+       defined(__STRICT_ANSI__) && __STRICT_ANSI__
 #   define __attribute__(x)
 #  endif
 # endif





reply via email to

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