diff options
author | Phil Jones <philj56@gmail.com> | 2022-08-02 13:32:29 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-08-02 13:32:29 +0100 |
commit | 85b85d735594ce9c1fe5db57fc5bd8cd1cddf45e (patch) | |
tree | 7d400edb216daa80a7768183479be8d277fe85c5 /src/xmalloc.h | |
parent | f90d6dd13dc6f6c4ca80174a8f3c17f37893b1ef (diff) |
Add a few more function attributes.
Diffstat (limited to 'src/xmalloc.h')
-rw-r--r-- | src/xmalloc.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/xmalloc.h b/src/xmalloc.h index 747509c..cf35712 100644 --- a/src/xmalloc.h +++ b/src/xmalloc.h @@ -3,15 +3,19 @@ #include <stdlib.h> -__attribute__((malloc)) +[[nodiscard("memory leaked")]] +[[gnu::malloc]] void *xmalloc(size_t size); -__attribute__((malloc)) +[[nodiscard("memory leaked")]] +[[gnu::malloc]] void *xcalloc(size_t nmemb, size_t size); +[[nodiscard("memory leaked")]] void *xrealloc(void *ptr, size_t size); -__attribute__((malloc)) +[[nodiscard("memory leaked")]] +[[gnu::malloc]] char *xstrdup(const char *s); #endif /* XMALLOC_H */ |