summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-19 08:08:59 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-19 08:08:59 +0000
commite9e9b245b98b8aeb8b8e898dce2b8c0f771602d6 (patch)
tree8cedb8e3ff9898a02990d88802319f68e99ac268 /misc
parent778c59c850879b2ffc7a396cecfa5a5ad68a40e6 (diff)
Update.
* misc/sys/cdefs.h: Define __attribute_malloc__ according to available gcc version. * string/string.h: Mark strdup, __strdup, and strndup with __attribute_malloc__. * stdlib/stdlib.h: Make malloc, calloc, realloc, and valloc with __attribute_malloc__. * malloc/malloc.h: Make malloc, calloc, realloc, valloc, pvallc, __morecore, and __default_morecore with __attribute_malloc__. Provide default definition for __attribute_malloc__. * libio/stdio.h: Make tempnam with __attribute_malloc__.
Diffstat (limited to 'misc')
-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