From c116728209e4ece3249564208e9387f67192a7f6 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; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.) --- src/feature/dirparse/parsecommon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/feature/dirparse') diff --git a/src/feature/dirparse/parsecommon.c b/src/feature/dirparse/parsecommon.c index 0c63cd4846..ab465c4d7f 100644 --- a/src/feature/dirparse/parsecommon.c +++ b/src/feature/dirparse/parsecommon.c @@ -222,7 +222,7 @@ token_check_object(memarea_t *area, const char *kwd, kwd, crypto_pk_num_bits(tok->key)); RET_ERR(ebuf); } - /* fall through */ + FALLTHROUGH; case NEED_KEY: /* There must be some kind of key. */ if (!tok->key) { tor_snprintf(ebuf, sizeof(ebuf), "Missing public key for %s", kwd); -- cgit v1.2.3-54-g00ecf