summaryrefslogtreecommitdiffstats
path: root/Macros.h
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-20 17:04:19 +0100
committerBenBE <BenBE@geshi.org>2021-01-11 21:08:58 +0100
commite6d536dd3f12bc7f5c56062a008d5c17e3417fa8 (patch)
tree91d01a06323a3c7c902963f113ac176fc010235a /Macros.h
parent37e186fd6626e83f51d0267052677355575964d4 (diff)
Add compiler hints on memory allocating utility functions
Diffstat (limited to 'Macros.h')
-rw-r--r--Macros.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Macros.h b/Macros.h
index 64aaefa5..31ba37b5 100644
--- a/Macros.h
+++ b/Macros.h
@@ -33,6 +33,9 @@
#define ATTR_NONNULL __attribute__((nonnull))
#define ATTR_NORETURN __attribute__((noreturn))
#define ATTR_UNUSED __attribute__((unused))
+#define ATTR_ALLOC_SIZE1(a) __attribute__((alloc_size (a)))
+#define ATTR_ALLOC_SIZE2(a, b) __attribute__((alloc_size (a, b)))
+#define ATTR_MALLOC __attribute__((malloc))
#else /* __GNUC__ */
@@ -40,6 +43,9 @@
#define ATTR_NONNULL
#define ATTR_NORETURN
#define ATTR_UNUSED
+#define ATTR_ALLOC_SIZE1(a)
+#define ATTR_ALLOC_SIZE2(a, b)
+#define ATTR_MALLOC
#endif /* __GNUC__ */

© 2014-2024 Faster IT GmbH | imprint | privacy policy