Skip to content

Commit 1fe81d4

Browse files
committed
psa_utils: Make fallthrough clear for compilers
Silence a compiler warning about implicit fallthrough by using a comment format the compiler understand to mean that the fallthrough is intentional. In file included from library/cipher.c:63:0: include/mbedtls/psa_util.h: In function ‘mbedtls_psa_translate_cipher_mode’: include/mbedtls/psa_util.h:91:15: error: this statement may fall through [-Werror=implicit-fallthrough=] if( taglen == 0 ) ^ include/mbedtls/psa_util.h:94:9: note: here default: ^~~~~~~ cc1: all warnings being treated as errors $ gcc --version gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1 parent 06b161a commit 1fe81d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/mbedtls/psa_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode(
9191
if( taglen == 0 )
9292
return( PSA_ALG_CBC_NO_PADDING );
9393
/* Intentional fallthrough for taglen != 0 */
94+
/* fallthrough */
9495
default:
9596
return( 0 );
9697
}

0 commit comments

Comments
 (0)