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:51:11 -0400 |
commit | cc397449fca8fb1559db3a790dffcd1e8046e86b (patch) | |
tree | 9ed93910dcd172f71d3b369a62b5e25ce370e962 /src/core/or/channeltls.c | |
parent | 78a72f8196505e28a5a823f24fdb74f36dc26845 (diff) | |
download | tor-cc397449fca8fb1559db3a790dffcd1e8046e86b.tar.gz tor-cc397449fca8fb1559db3a790dffcd1e8046e86b.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;
Diffstat (limited to 'src/core/or/channeltls.c')
-rw-r--r-- | src/core/or/channeltls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c index 4db283d20e..f874e39946 100644 --- a/src/core/or/channeltls.c +++ b/src/core/or/channeltls.c @@ -1238,7 +1238,7 @@ channel_tls_handle_var_cell(var_cell_t *var_cell, or_connection_t *conn) /* But that should be happening any longer've disabled bufferevents. */ tor_assert_nonfatal_unreached_once(); - /* fall through */ + FALLTHROUGH; case OR_CONN_STATE_TLS_SERVER_RENEGOTIATING: if (!(command_allowed_before_handshake(var_cell->command))) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, |