From 9aa4490263ead62dc545cf0e8b83e0ef77eb7a6e Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 18 Jul 2023 23:07:05 +0200 Subject: Make use of the alloc_size attribute --- 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 2f81fc0..dde19a2 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -78,6 +78,13 @@ #define __malloc(...) #endif +#if __has_attribute (alloc_size) +#define __alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__))) +#else +#define __alloc_size(...) +#endif + + #endif /* __has_attribute */ -- cgit v1.3