From 10b2c56677c1708289779e4ce37a958a8cf37533 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 17 Mar 2024 12:32:40 -0400 Subject: config: Don't mix [[attr]] and __attribute__((attr)) GCC and Clang don't support combining the two attribute syntaxes in arbitrary order. For now, just use the GNU style. --- src/config.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h index ad2e481..45422a2 100644 --- a/src/config.h +++ b/src/config.h @@ -203,9 +203,7 @@ typedef long double max_align_t; /** * Silence warnings about unused declarations. */ -#if __has_c_attribute(maybe_unused) -# define attr_maybe_unused [[maybe_unused]] -#elif __has_attribute(unused) +#if __has_attribute(unused) # define attr_maybe_unused __attribute__((unused)) #else # define attr_maybe_unused @@ -214,9 +212,7 @@ typedef long double max_align_t; /** * Warn if a value is unused. */ -#if __has_c_attribute(nodiscard) -# define attr_nodiscard [[nodiscard]] -#elif __has_attribute(warn_unused_result) +#if __has_attribute(warn_unused_result) # define attr_nodiscard __attribute__((warn_unused_result)) #else # define attr_nodiscard -- cgit v1.2.3