diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2021-08-26 23:53:14 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2021-08-26 23:53:14 +0200 |
commit | a0b9f2fb512ba61a058ed1c10f330900df911bbb (patch) | |
tree | 02dabe36e644f9996fffd544236e8927a144cc3c /xmalloc.h | |
parent | 46a82e131538598179db3302169f48a962760327 (diff) | |
download | fetchmail-a0b9f2fb512ba61a058ed1c10f330900df911bbb.tar.gz fetchmail-a0b9f2fb512ba61a058ed1c10f330900df911bbb.tar.bz2 fetchmail-a0b9f2fb512ba61a058ed1c10f330900df911bbb.zip |
xmalloc.h: Add GCC malloc attribute to xmalloc().
Diffstat (limited to 'xmalloc.h')
-rw-r--r-- | xmalloc.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -17,8 +17,12 @@ extern "C" { #define XMALLOCTYPE char #endif +#if !defined __GNUC__ || __GNUC__ < 2 +# define __attribute__(xyz) /* Ignore. */ +#endif + /** Allocate \a n characters of memory, abort program on failure. */ -XMALLOCTYPE *xmalloc(size_t n); +XMALLOCTYPE *xmalloc(size_t n) __attribute__((malloc)); /** Reallocate \a n characters of memory, abort program on failure. */ XMALLOCTYPE *xrealloc(/*@null@*/ void *, size_t n); |