From 5c4ca32f936753bfe586649b28abea74b81d285f Mon Sep 17 00:00:00 2001 From: Mateusz Starzyk Date: Thu, 5 Aug 2021 13:56:48 +0200 Subject: [PATCH] Silence warnings about unused return value This macro is not used inside the library yet, but may be used in deprecated functions in the future, if a function returning void has to change to returning an error. It may also be useful in user code, so it is in a public header. Signed-off-by: Mateusz Starzyk Signed-off-by: Gilles Peskine --- include/mbedtls/platform_util.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/mbedtls/platform_util.h b/include/mbedtls/platform_util.h index e1f063c34..0882dc68d 100644 --- a/include/mbedtls/platform_util.h +++ b/include/mbedtls/platform_util.h @@ -129,6 +129,13 @@ MBEDTLS_DEPRECATED typedef int mbedtls_deprecated_numeric_constant_t; */ #define MBEDTLS_CHECK_RETURN_OPTIONAL +/** \def MBEDTLS_IGNORE_RETURN + * + * Silences warning about unused return value given by functions + * with \c MBEDTLS_CHECK_RETURN attribute. + */ +#define MBEDTLS_IGNORE_RETURN(result) if( result ) {} + /** * \brief Securely zeroize a buffer *