From 5ce4b94b7ac1d529b42ac76609b686d1ba0dffcb Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 11 Sep 2023 17:41:31 +0200 Subject: Add the warn_unused_result attribute to alloc-related functions --- include/fortify-headers.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/fortify-headers.h') diff --git a/include/fortify-headers.h b/include/fortify-headers.h index dbace47..74c814b 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -110,6 +110,13 @@ #define __error_if(cond, msg) #endif +#if __has_attribute (warn_unused_result) +#define __warn_unused_result __attribute__ ((warn_unused_result)) +#else +#define __warn_unused_result +#endif + + #endif /* __has_attribute */ /* -- cgit v1.3