aboutsummaryrefslogtreecommitdiff
path: root/misc/sys/cdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'misc/sys/cdefs.h')
-rw-r--r--misc/sys/cdefs.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 84e24b0b62..7db057560d 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -136,7 +136,16 @@
they are omitted for compilers that don't understand it. */
#if !defined __GNUC__ || __GNUC__ < 2
-# define __attribute__(xyz) /* Ignore. */
+# define __attribute__(xyz) /* Ignore */
+
+/* At some point during the gcc 2.96 development the `malloc' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+# if __GNUC_PREREQ (2,96)
+# define __attribute_malloc__ __attribute__ ((__malloc__))
+# else
+# define __attribute_malloc__ /* Ignore */
+# endif
#endif