summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-04-08 09:31:14 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-04-08 09:31:14 +0200
commit772e430d840a6479da87d4cd701d42695476c52e (patch)
tree8425ba27a4b5a3a41a13358748bf84fdded2377e /compiler.h
parentcd53a2b488f4107e48a80eb336e2b1001591246a (diff)
util: Add attribute warn_unused_result to allocation functions
Add the warn_unused_result GCC function attribute to all allocation functions in xmalloc. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'compiler.h')
-rw-r--r--compiler.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler.h b/compiler.h
index a6bf3a6..3559050 100644
--- a/compiler.h
+++ b/compiler.h
@@ -21,6 +21,7 @@
#ifdef __GNUC__
# define __noreturn __attribute__((noreturn))
+# define __warn_unused_result __attribute__((warn_unused_result))
# define __packed __attribute__((packed))
# define __unused __attribute__((unused))
# ifndef offsetof