From 08867473e75e8e20ca76c7fb181204839e28b271 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 3 Jan 2024 15:00:00 -0500 Subject: config: Check for GCC >= 11 before using malloc attribute args --- src/config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h index 7dd9dc2..ed9a869 100644 --- a/src/config.h +++ b/src/config.h @@ -253,10 +253,10 @@ typedef long double max_align_t; * Annotates allocator-like functions. */ #if __has_attribute(malloc) -# if __clang__ -# define attr_malloc(...) attr_nodiscard __attribute__((malloc)) -# else +# if __GNUC__ >= 11 # define attr_malloc(...) attr_nodiscard __attribute__((malloc(__VA_ARGS__))) +# else +# define attr_malloc(...) attr_nodiscard __attribute__((malloc)) # endif #else # define attr_malloc(...) attr_nodiscard -- cgit v1.2.3