[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
obstack.c uses unprotected __attribute__ directive
From: |
Jim Meyering |
Subject: |
obstack.c uses unprotected __attribute__ directive |
Date: |
Sat, 14 Jul 2001 21:46:27 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.104 |
Hi,
obstack.c's uses of __attribute__ causes a compile failure
with non-gcc compilers: E.g., with mips-sgi-irix6.2's cc
cfe: Error: obstack.c, line 475: Syntax Error
__attribute__ ((noreturn))
---------------^
cfe: Error: obstack.c, line 475: Syntax Error
__attribute__ ((noreturn))
-------------------------^
Here's one way to fix it:
Index: obstack.c
===================================================================
RCS file: /fetish/cppi/obstack.c,v
retrieving revision 1.13
diff -u -1 -r1.13 obstack.c
--- obstack.c 2001/06/18 08:01:38 1.13
+++ obstack.c 2001/07/14 19:40:55
@@ -473,2 +473,9 @@
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# define __attribute__(Spec) /* empty */
+# endif
+#endif
+
static void
- obstack.c uses unprotected __attribute__ directive,
Jim Meyering <=