diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-11-20 17:04:19 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-01-11 21:08:58 +0100 |
commit | e6d536dd3f12bc7f5c56062a008d5c17e3417fa8 (patch) | |
tree | 91d01a06323a3c7c902963f113ac176fc010235a /Macros.h | |
parent | 37e186fd6626e83f51d0267052677355575964d4 (diff) |
Add compiler hints on memory allocating utility functions
Diffstat (limited to 'Macros.h')
-rw-r--r-- | Macros.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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__ */ |