aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/sendme.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-05-06 10:45:48 -0400
committerNick Mathewson <nickm@torproject.org>2020-05-06 16:55:25 -0400
commitc116728209e4ece3249564208e9387f67192a7f6 (patch)
tree709e04b04039446a6e050c0b14934e48e256177c /src/core/or/sendme.c
parenta1365b91ff43e6e520b9a881f720767418daccf6 (diff)
downloadtor-c116728209e4ece3249564208e9387f67192a7f6.tar.gz
tor-c116728209e4ece3249564208e9387f67192a7f6.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.3 version.)
Diffstat (limited to 'src/core/or/sendme.c')
-rw-r--r--src/core/or/sendme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/or/sendme.c b/src/core/or/sendme.c
index db3e2e94fd..788f56088c 100644
--- a/src/core/or/sendme.c
+++ b/src/core/or/sendme.c
@@ -293,7 +293,7 @@ send_circuit_level_sendme(circuit_t *circ, crypt_path_t *layer_hint,
log_debug(LD_PROTOCOL, "Emitting SENDME version 1 cell.");
break;
case 0x00:
- /* Fallthrough because default is to use v0. */
+ FALLTHROUGH;
default:
/* Unknown version, fallback to version 0 meaning no payload. */
payload_len = 0;