Skip to content

Commit

Permalink
Fix switch-case fallthrough compilation warning (bytecodealliance#2753)
Browse files Browse the repository at this point in the history
The commit fa5e9d7 ("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 fb4afc7 ("Apply clang-format for core/iwasm compilation and libraries"),
add one line "// Fallthrough." to make compiler happy.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
  • Loading branch information
haiyuewa authored Nov 13, 2023
1 parent 7ff11c8 commit 5fa38b4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5fa38b4

Please sign in to comment.