From cc397449fca8fb1559db3a790dffcd1e8046e86b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 6 May 2020 10:45:48 -0400 Subject: 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; --- src/core/or/circuituse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/or/circuituse.c') diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c index 000a7c36da..7273be3510 100644 --- a/src/core/or/circuituse.c +++ b/src/core/or/circuituse.c @@ -780,7 +780,7 @@ circuit_expire_building(void) TO_ORIGIN_CIRCUIT(victim)->build_state->pending_final_cpath == NULL) break; - /* fallthrough! */ + FALLTHROUGH; case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT: case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED: /* If we have reached this line, we want to spare the circ for now. */ -- cgit v1.2.3-54-g00ecf