From 1ec1a0f0cc74cfe94c883932103edf0e9f26cdcc Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 4 Oct 2023 13:50:54 +0100 Subject: [PATCH] Introduce MBEDTLS_MAYBE_UNUSED Signed-off-by: Dave Rodgman --- library/common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/common.h b/library/common.h index 3c472c685..1fc04a32e 100644 --- a/library/common.h +++ b/library/common.h @@ -334,4 +334,11 @@ static inline void mbedtls_xor_no_simd(unsigned char *r, #define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE #endif +/* Suppress compiler warnings for unused functions and variables. */ +#if defined(__GNUC__) +#define MBEDTLS_MAYBE_UNUSED __attribute__((unused)) +#else +#define MBEDTLS_MAYBE_UNUSED +#endif + #endif /* MBEDTLS_LIBRARY_COMMON_H */