From 625c95816df07b0ee896bbd2b587aae3b147edb2 Mon Sep 17 00:00:00 2001 From: Haiyue Wang Date: Mon, 13 Nov 2023 15:01:13 +0800 Subject: [PATCH] Fix switch-case fallthrough compilation warning (#2753) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit fa5e9d72b039 ("Abstract POSIX filesystem functions") introduces the build warning: ./core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c: In function ‘fd_object_release’: ./core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:545:20: warning: this statement may fall through [-Wimplicit-fallthrough=] 545 | if (os_is_dir_stream_valid(&fo->directory.handle)) { | ^ ./core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:549:13: note: here 549 | default: | ^~~~~~~ Refer to the commit fb4afc7ca43a ("Apply clang-format for core/iwasm compilation and libraries"), add one line "// Fallthrough." to make compiler happy. Signed-off-by: Haiyue Wang --- .../libraries/libc-wasi/sandboxed-system-primitives/src/posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c index 9801a4c58..385aa15cf 100644 --- a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c +++ b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c @@ -546,6 +546,7 @@ fd_object_release(wasm_exec_env_t env, struct fd_object *fo) error = os_closedir(fo->directory.handle); break; } + // Fallthrough. default: // The env == NULL case is for // fd_table_destroy, path_get, path_put,