diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-05-06 10:45:48 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-05-06 16:52:03 -0400 |
commit | 79ff2b6aab13011197e8342763de3cae48700dfb (patch) | |
tree | cf55f9e1b9d5f19bd4cea2a33c76ffd1556194fb /src/feature/relay/dns.c | |
parent | dd0ee016e9e386410c374d0dd421f5683ec8476e (diff) | |
download | tor-79ff2b6aab13011197e8342763de3cae48700dfb.tar.gz tor-79ff2b6aab13011197e8342763de3cae48700dfb.zip |
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.1 version.)
Diffstat (limited to 'src/feature/relay/dns.c')
-rw-r--r-- | src/feature/relay/dns.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c index d9662962d2..d62598d46f 100644 --- a/src/feature/relay/dns.c +++ b/src/feature/relay/dns.c @@ -548,7 +548,7 @@ send_resolved_cell,(edge_connection_t *conn, uint8_t answer_type, answer_type = RESOLVED_TYPE_ERROR; /* We let this fall through and treat it as an error. */ } - /* Falls through. */ + FALLTHROUGH; case RESOLVED_TYPE_ERROR_TRANSIENT: case RESOLVED_TYPE_ERROR: { |