diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-01-03 15:00:00 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-01-03 15:00:56 -0500 |
commit | 08867473e75e8e20ca76c7fb181204839e28b271 (patch) | |
tree | 86a92ad2dd67930fe99951950dd802cdf8e62e6d /src/config.h | |
parent | 5b8c0174d936a6c89a6e98ceeb22b74cfc27595b (diff) | |
download | bfs-08867473e75e8e20ca76c7fb181204839e28b271.tar.xz |
config: Check for GCC >= 11 before using malloc attribute args
Diffstat (limited to 'src/config.h')
-rw-r--r-- | src/config.h | 6 |
1 files changed, 3 insertions, 3 deletions
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 |