From 9bb341f9ad4afb107a7515a85357a60ab7c91176 Mon Sep 17 00:00:00 2001 From: Norbert Manthey Date: Fri, 21 Aug 2020 15:49:42 +0200 Subject: [PATCH] fallthrough: silence warnings In some switch statements, we want to combine case statements. However, compilers and code analysis tools warn about these cases. To silence them and acknowledge the behavior as expected, label the intentional cases. Signed-off-by: Norbert Manthey --- lib/string.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/string.c b/lib/string.c index 0b25421d..3f02a3be 100644 --- a/lib/string.c +++ b/lib/string.c @@ -386,6 +386,9 @@ reswitch: switch (ch = (unsigned char)*fmt++) { goto handle_nosign; case 'X': upper = 1; + #if defined(__GNUC__) && !defined(__clang__) + __attribute__ ((fallthrough)); + #endif case 'x': base = 16; goto handle_nosign;