aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirparse
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:51:11 -0400
commitcc397449fca8fb1559db3a790dffcd1e8046e86b (patch)
tree9ed93910dcd172f71d3b369a62b5e25ce370e962 /src/feature/dirparse
parent78a72f8196505e28a5a823f24fdb74f36dc26845 (diff)
downloadtor-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/feature/dirparse')
-rw-r--r--src/feature/dirparse/parsecommon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/feature/dirparse/parsecommon.c b/src/feature/dirparse/parsecommon.c
index e8269f7ec7..1664a77bbe 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);