aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.h
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2021-08-26 23:53:14 +0200
committerMatthias Andree <matthias.andree@gmx.de>2021-08-26 23:53:14 +0200
commita0b9f2fb512ba61a058ed1c10f330900df911bbb (patch)
tree02dabe36e644f9996fffd544236e8927a144cc3c /xmalloc.h
parent46a82e131538598179db3302169f48a962760327 (diff)
downloadfetchmail-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.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmalloc.h b/xmalloc.h
index 70ed0a0b..fd84ebed 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -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);