diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2025-05-15 18:05:01 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2025-06-04 12:32:04 +0200 |
commit | 515b5ee53aac7b04254b5072ab624def58dac0d8 (patch) | |
tree | b97e05578adf52d7a2fb76d1b979711fa6867087 | |
parent | e019323538699967c155c29411545223dadfc0f5 (diff) | |
download | passt-515b5ee53aac7b04254b5072ab624def58dac0d8.tar passt-515b5ee53aac7b04254b5072ab624def58dac0d8.tar.gz passt-515b5ee53aac7b04254b5072ab624def58dac0d8.tar.bz2 passt-515b5ee53aac7b04254b5072ab624def58dac0d8.tar.lz passt-515b5ee53aac7b04254b5072ab624def58dac0d8.tar.xz passt-515b5ee53aac7b04254b5072ab624def58dac0d8.tar.zst passt-515b5ee53aac7b04254b5072ab624def58dac0d8.zip |
tap: Avoid bogus missingReturn cppcheck warning in tap_l2_max_len()
Cppcheck 2.14.2 on Alpine Linux (musl) says that:
tap.c:111:19: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
switch (c->mode) {
^
This exit path is not reachable because we ASSERT(0) after the switch,
but for some reason cppcheck doesn't see this with musl headers. Hide
the warning with a redundant return statement.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | tap.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -118,6 +118,8 @@ unsigned long tap_l2_max_len(const struct ctx *c) } /* NOLINTEND(bugprone-branch-clone) */ ASSERT(0); + + return 0; /* Unreachable, for cppcheck's sake */ } /** |