From 1fe81d49859446890e627cba07c09c9252a667cf Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Mon, 11 Feb 2019 12:18:39 +0000 Subject: [PATCH] psa_utils: Make fallthrough clear for compilers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- include/mbedtls/psa_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index 3684e98358..fbf25e6383 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -91,6 +91,7 @@ static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode( if( taglen == 0 ) return( PSA_ALG_CBC_NO_PADDING ); /* Intentional fallthrough for taglen != 0 */ + /* fallthrough */ default: return( 0 ); }