Add more 'fall through' switch comments 25/14125/16
authorCheyenne Wills <cwills@sinenomine.net>
Fri, 3 Apr 2020 21:00:42 +0000 (15:00 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 14 May 2020 03:35:09 +0000 (23:35 -0400)
commit929d501421579290ce1d4f9aabe45980e5458a9a
treee130d626bf0b2a48613ee883f59b15f674cfc266
parent4512d04a9b721cd9052c0e8fe026c93faf6edb9e
Add more 'fall through' switch comments

Commit a455452d (LINUX 5.3: Add comments for fallthrough switch cases)
added the special /* fall through */ comment to various switch/case
blocks, in order to avoid implicit-fallthrough warnings from causing
the build to fail when building the Linux kernel module.

In this commit, add additional /* fall through */ comments to the rest
of the tree where falling through is intentional. Add a "break;" in one
place in dumptool.c where falling through seems like a mistake, and flag
certain functions as AFS_NORETURN to avoid needing to explicitly break
or fallthrough.

Check for the availability of the -Wimplicit-fallthrough compiler flag
and use it when --enable-checking is set, to prevent additional cases
from creeping into the tree.

Note: the -Wimplicit-fallthrough compiler flag was added in gcc 7.

Change-Id: Iae34e7969606603da8358d7cfa5fd04279b218dc
Reviewed-on: https://gerrit.openafs.org/14125
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
12 files changed:
src/butc/dump.c
src/cf/osconf.m4
src/cmd/cmd.c
src/opr/jhash.h
src/tools/dumpscan/afsdump_dirlist.c
src/tools/dumpscan/afsdump_extract.c
src/tools/dumpscan/afsdump_scan.c
src/tools/dumpscan/dumptool.c
src/tools/dumpscan/parsevnode.c
src/vol/salvaged.c
src/vol/salvsync-server.c
src/vol/volume.c