mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Introduce MBEDTLS_IGNORE_UNREACHABLE_BEGIN
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@ -334,4 +334,23 @@ static inline void mbedtls_xor_no_simd(unsigned char *r,
|
|||||||
#define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE
|
#define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Define macros that can be used to disable warnings about unreachable code. */
|
||||||
|
#if defined(__clang__)
|
||||||
|
|
||||||
|
#define MBEDTLS_PRAGMA(x) _Pragma(#x)
|
||||||
|
|
||||||
|
#define MBEDTLS_IGNORE_UNREACHABLE_BEGIN \
|
||||||
|
MBEDTLS_PRAGMA(clang diagnostic push) \
|
||||||
|
MBEDTLS_PRAGMA(clang diagnostic ignored "-Wunreachable-code")
|
||||||
|
|
||||||
|
#define MBEDTLS_IGNORE_UNREACHABLE_END \
|
||||||
|
MBEDTLS_PRAGMA(clang diagnostic pop)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define MBEDTLS_IGNORE_UNREACHABLE_BEGIN
|
||||||
|
#define MBEDTLS_IGNORE_UNREACHABLE_END
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* MBEDTLS_LIBRARY_COMMON_H */
|
#endif /* MBEDTLS_LIBRARY_COMMON_H */
|
||||||
|
Reference in New Issue
Block a user