1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
* 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__.
This commit is contained in:
Ulrich Drepper
1999-12-19 08:08:59 +00:00
parent 778c59c850
commit e9e9b245b9
7 changed files with 50 additions and 16 deletions

View File

@ -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