Use __attribute__((fallthrough)) rather than magic GCC comments.
commit28ac17f433d954355494989983005498c7fe9292
authorNick Mathewson <nickm@torproject.org>
Wed, 6 May 2020 14:45:48 +0000 (6 10:45 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 6 May 2020 20:53:40 +0000 (6 16:53 -0400)
tree67d3313f95eaa7630cfd055b5f5f0b2933cf6d99
parentf954514b376e6edbe8b1faba0726bdb46acf7729
Use __attribute__((fallthrough)) rather than magic GCC comments.

GCC added an implicit-fallthrough warning a while back, where it
would complain if you had a nontrivial "case:" block that didn't end
with break, return, or something like that.  Clang recently added
the same thing.

GCC, however, would let you annotate a fall-through as intended by
any of various magic "/* fall through */" comments.  Clang, however,
only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
accepts that too.

A previous commit in this branch defined a FALLTHROUGH macro to do
the right thing if GNUC is defined; here we replace all of our "fall
through" comments with uses of that macro.

This is an automated commit, made with the following perl one-liner:

  #!/usr/bin/perl -i -p
  s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;

(In order to avoid conflicts, I'm applying this script separately to
each maint branch. This is the 0.4.2 version.)
25 files changed:
src/core/or/channeltls.c
src/core/or/circuitbuild.c
src/core/or/circuitlist.c
src/core/or/circuituse.c
src/core/or/connection_edge.c
src/core/or/crypt_path.c
src/core/or/onion.c
src/core/or/policies.c
src/core/or/reasons.c
src/core/or/relay.c
src/core/or/scheduler.c
src/core/or/sendme.c
src/core/proto/proto_socks.c
src/ext/csiphash.c
src/ext/ed25519/donna/modm-donna-32bit.h
src/ext/ed25519/donna/modm-donna-64bit.h
src/feature/client/entrynodes.c
src/feature/control/control_cmd.c
src/feature/dirclient/dirclient.c
src/feature/dirparse/parsecommon.c
src/feature/relay/dns.c
src/feature/rend/rendclient.c
src/lib/crypt_ops/crypto_digest_nss.c
src/lib/crypt_ops/crypto_digest_openssl.c
src/test/test_socks.c