summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-03-17 12:32:40 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-03-19 14:07:58 -0400
commit10b2c56677c1708289779e4ce37a958a8cf37533 (patch)
tree0f82f7d484a111d0f201c90059ecef3d60682c86
parent2c3ef3a06ee1f951f6d68be6d0d3f6a1822b05b7 (diff)
downloadbfs-10b2c56677c1708289779e4ce37a958a8cf37533.tar.xz
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.
-rw-r--r--src/config.h8
1 files changed, 2 insertions, 6 deletions
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