From b1557fe98120132e6671924af4ed69f4e21d3de4 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 16 May 2017 09:18:24 +0100 Subject: misc: fix ggc-7 fallthrough warnings (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier Suggested-by: Karel Zak Signed-off-by: Sami Kerola --- sys-utils/ipcrm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys-utils/ipcrm.c') diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c index 0432b224f..5b71f7d81 100644 --- a/sys-utils/ipcrm.c +++ b/sys-utils/ipcrm.c @@ -346,6 +346,7 @@ int main(int argc, char **argv) ret++; break; } + /* fallthrough */ case 'm': if (!iskey) id = strtos32_or_err(optarg, _("failed to parse argument")); @@ -359,6 +360,7 @@ int main(int argc, char **argv) ret++; break; } + /* fallthrough */ case 'q': if (!iskey) id = strtos32_or_err(optarg, _("failed to parse argument")); @@ -372,6 +374,7 @@ int main(int argc, char **argv) ret++; break; } + /* fallthrough */ case 's': if (!iskey) id = strtos32_or_err(optarg, _("failed to parse argument")); -- cgit v1.2.3-55-g7522