summaryrefslogtreecommitdiff
path: root/built_in.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-04-07 14:36:16 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-04-07 14:41:45 +0200
commitbb77b49265877b68fc316d11a719527ecf91d594 (patch)
treef76e62ea1cf39b54d9f0b486745f97648b3f8f6a /built_in.h
parent87103d95678b0e6c784909e0bc610ed7ae02d2c9 (diff)
xmalloc: 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 'built_in.h')
-rw-r--r--built_in.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/built_in.h b/built_in.h
index 8e1ba0d..6ebf27e 100644
--- a/built_in.h
+++ b/built_in.h
@@ -73,7 +73,11 @@ typedef uint8_t u8;
#endif
#ifndef __maybe_unused
-# define __maybe_unused __attribute__ ((__unused__))
+# define __maybe_unused __attribute__((__unused__))
+#endif
+
+#ifndef __warn_unused_result
+# define __warn_unused_result __attribute__((warn_unused_result))
#endif
#ifndef noinline