summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-06-14 13:40:01 +0000
committerbde <bde@FreeBSD.org>1998-06-14 13:40:01 +0000
commita7d3dec6df55d42bcb12806631798932380ce34b (patch)
tree38da8a791e08d1db129ea0667a0929fcebeba622
parent1eddce4e7b53dec621dcf76678415a51d092805d (diff)
downloadFreeBSD-src-a7d3dec6df55d42bcb12806631798932380ce34b.zip
FreeBSD-src-a7d3dec6df55d42bcb12806631798932380ce34b.tar.gz
Don't define away __attribute__() for the non-gcc and old-gcc cases.
Using __attribute__() in non-ifdefed code is just wrong if it changes the semantics, and there is no way to ignore __attribute__() only in the benign cases. Don't use __attribute__ in non-ifdefed code here. It was a benign case, but we already have a macro (__unused) for this case. Expanded comment about gotchas for __CONCAT() in the non-ANSI case.
-rw-r--r--sys/sys/cdefs.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 67f44d5..5640fde 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
- * $Id: cdefs.h,v 1.15 1997/12/13 20:39:14 pst Exp $
+ * $Id: cdefs.h,v 1.16 1998/05/28 18:04:34 dt Exp $
*/
#ifndef _SYS_CDEFS_H_
@@ -52,9 +52,11 @@
/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
- * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
- * in between its arguments. __CONCAT can also concatenate double-quoted
- * strings produced by the __STRING macro, but this only works with ANSI C.
+ * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
+ * mode -- there must be no spaces between its arguments, and for nested
+ * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
+ * concatenate double-quoted strings produced by the __STRING macro, but
+ * this only works with ANSI C.
*
* __XSTRING is like __STRING, but it expands any macros in its argument
* first. It is only available with ANSI C.
@@ -118,7 +120,6 @@
#define __pure
#define __pure2
#define __unused
-#define __attribute__(x)
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ < 5
#define __dead __volatile
@@ -160,8 +161,7 @@
#endif
#endif
-#define __IDSTRING(name,string) \
- static const char name[] __attribute__((__unused__)) = string
+#define __IDSTRING(name,string) static const char name[] __unused = string
#ifndef __RCSID
#define __RCSID(s) __IDSTRING(rcsid,s)
OpenPOWER on IntegriCloud