From 85b85d735594ce9c1fe5db57fc5bd8cd1cddf45e Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 2 Aug 2022 13:32:29 +0100 Subject: Add a few more function attributes. --- src/xmalloc.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/xmalloc.h') 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 -__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 */ -- cgit v1.2.3