mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-26 19:51:32 +00:00
Annotate switch/case fallthrough
commit 7a1206adf33595a50b669d4027b72ad0786fb12f category: bugfix issue: #I6VAS0 CVE: NA Signed-off-by: DongSenhao <dongsenhao2@huawei.com> --------------------------------------- Just like in the Linux kernel source code, annotate switch/case fallthrough. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
parent
5a3dc5cd85
commit
094b306b3b
@ -1669,6 +1669,7 @@ static int __chk_dentries(struct f2fs_sb_info *sbi, int casefolded,
|
||||
switch (ret) {
|
||||
case 1:
|
||||
fixed = 1;
|
||||
fallthrough;
|
||||
case 0:
|
||||
child->dots++;
|
||||
break;
|
||||
|
@ -370,6 +370,7 @@ void f2fs_parse_options(int argc, char *argv[])
|
||||
exit(0);
|
||||
case '?':
|
||||
option = optopt;
|
||||
fallthrough;
|
||||
default:
|
||||
err = EUNKNOWN_OPT;
|
||||
break;
|
||||
|
@ -73,6 +73,12 @@
|
||||
#define static_assert _Static_assert
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
#define fallthrough do {} while (0) /* fall through */
|
||||
#else
|
||||
#define fallthrough __attribute__((__fallthrough__))
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#undef HAVE_LINUX_TYPES_H
|
||||
#endif
|
||||
|
@ -726,6 +726,7 @@ static void do_add_key(int argc, char **argv, const struct cmd_desc *cmd)
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unrecognized option: %c\n", opt);
|
||||
fallthrough;
|
||||
case '?':
|
||||
fputs("USAGE:\n ", stderr);
|
||||
fputs(cmd->cmd_help, stderr);
|
||||
|
Loading…
Reference in New Issue
Block a user