]> git.ipfire.org Git - thirdparty/util-linux.git/commit
misc: fix ggc-7 fallthrough warnings
authorSami Kerola <kerolasa@iki.fi>
Tue, 16 May 2017 08:18:24 +0000 (09:18 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 13 Jun 2017 19:47:17 +0000 (21:47 +0200)
commit3a5ce6e7efe62e1f583c090f907bf8518ce2f4ba
treeae92a2fa8d1d94271b534035137b0662ea33e2de
parent26cd36a6361977c362886595e1dc37e163966ead
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 <ruediger.meier@ga-group.nl>
Suggested-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
16 files changed:
disk-utils/mkfs.cramfs.c
login-utils/last.c
login-utils/su-common.c
login-utils/sulogin.c
misc-utils/cal.c
misc-utils/rename.c
sys-utils/flock.c
sys-utils/hwclock.c
sys-utils/ipcrm.c
sys-utils/nsenter.c
sys-utils/unshare.c
term-utils/agetty.c
text-utils/hexdump-parse.c
text-utils/more.c
text-utils/pg.c
text-utils/ul.c