X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Feealloc.h;h=7249ac797fc3a6c7d76d26b1a4439f65ac21239f;hb=34f19098068439da352e5dbac4e431220557f812;hp=02cd7925e1817b87a677c17d25a85a3b1550f821;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=pspp diff --git a/lib/eealloc.h b/lib/eealloc.h index 02cd7925e1..7249ac797f 100644 --- a/lib/eealloc.h +++ b/lib/eealloc.h @@ -1,5 +1,5 @@ /* Memory allocation with expensive empty allocations. - Copyright (C) 2003, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2003, 2008, 2010-2011 Free Software Foundation, Inc. Written by Bruno Haible , 2003, based on prior work by Jim Meyering. @@ -35,7 +35,12 @@ # define eemalloc malloc #else # if __GNUC__ >= 3 -static inline void *eemalloc (size_t n) __attribute__ ((__malloc__)); +static inline void *eemalloc (size_t n) + __attribute__ ((__malloc__)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) + __attribute__ ((__alloc_size__ (1))) +# endif + ; # endif static inline void * eemalloc (size_t n) @@ -50,6 +55,10 @@ eemalloc (size_t n) #if REALLOC_0_IS_NONNULL # define eerealloc realloc #else +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +static inline void *eerealloc (void *p, size_t n) + __attribute__ ((__alloc_size__ (2))); +# endif static inline void * eerealloc (void *p, size_t n) {