summaryrefslogtreecommitdiffstats
path: root/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index a474fb3..9f95674 100644
--- a/src/config.h
+++ b/src/config.h
@@ -186,7 +186,7 @@ typedef long double max_align_t;
// Wrappers for attributes
/**
- * Silence compiler warnings about switch/case fall-throughs.
+ * Silence warnings about switch/case fall-throughs.
*/
#if __has_c_attribute(fallthrough)
# define fallthru [[fallthrough]]
@@ -197,6 +197,17 @@ typedef long double max_align_t;
#endif
/**
+ * Silence warnings about unused declarations.
+ */
+#if __has_c_attribute(maybe_unused)
+# define attr_maybe_unused [[maybe_unused]]
+#elif __has_attribute(unused)
+# define attr_maybe_unused __attribute__((unused))
+#else
+# define attr_maybe_unused
+#endif
+
+/**
* Warn if a value is unused.
*/
#if __has_c_attribute(nodiscard)