From 36f539d9b396ab774e83665b3dd1ac7d18a671f2 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Tue, 9 Mar 2021 16:51:02 +0000 Subject: [PATCH] Remove deliberate fallthrough Clang 11 has stopped using the old comment system to mark deliberate fallthrough, and now demands marking of such with __attribute(fallthrough). Given not every compiler supports such attributes and these are the only two deliberate fallthrough cases in the project at the minute, take the easy route and just remove the fallthrough. Signed-off-by: Paul Elliott --- include/mbedtls/psa_util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index f18857cf5..691ff3c3d 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -92,8 +92,8 @@ static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode( case MBEDTLS_MODE_CBC: if( taglen == 0 ) return( PSA_ALG_CBC_NO_PADDING ); - /* Intentional fallthrough for taglen != 0 */ - /* fallthrough */ + else + return( 0 ); default: return( 0 ); } @@ -151,7 +151,8 @@ static inline psa_algorithm_t mbedtls_psa_translate_md( mbedtls_md_type_t md_alg case MBEDTLS_MD_RIPEMD160: return( PSA_ALG_RIPEMD160 ); #endif - case MBEDTLS_MD_NONE: /* Intentional fallthrough */ + case MBEDTLS_MD_NONE: + return( 0 ); default: return( 0 ); }