BUILD: Re-enable -Wimplicit-fallthrough
Getting rid of this warning is cleaner solved using a 'fall through' comment,
because it clarifies intent to a human reader.
This patch adjust a few places that cause -Wimplicit-fallthrough to trigger:
- Fix typos in the comment.
- Remove redundant 'no break' that trips up gcc from comment.
- Move the comment out of the block when the 'case' is completely surrounded
by braces.
- Add comments where I could determine that the fall through was intentional.
Changes tested on
gcc (Debian 9.3.0-13) 9.3.0
Copyright (C) 2019 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.
using
make -j4 all TARGET=linux-glibc USE_OPENSSL=1 USE_LUA=1 USE_ZLIB=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_GETADDRINFO=1
diff --git a/src/hlua.c b/src/hlua.c
index 6a75e88..18c8307 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -6255,6 +6255,7 @@
case HLUA_E_ERR:
/* Display log. */
SEND_ERR(stream->be, "Lua converter '%s' returns an unknown error.\n", fcn->name);
+ /* fall through */
default:
return 0;
@@ -6388,6 +6389,7 @@
case HLUA_E_ERR:
/* Display log. */
SEND_ERR(smp->px, "Lua sample-fetch '%s' returns an unknown error.\n", fcn->name);
+ /* fall through */
default:
return 0;