summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-01-27 00:50:10 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-01-31 14:04:55 -0500
commitec251fe7d5bc24b5d38b0853bc5969f3a0ba06e2 (patch)
treec37bae4fdc7a54ebbe6abcb394a6019efc619c61 /src/basic
parent9ce6d1b319f8655100af6ecf5fd57e4558d57dd1 (diff)
tree-wide: adjust fall through comments so that gcc is happy
gcc 7 adds -Wimplicit-fallthrough=3 to -Wextra. There are a few ways we could deal with that. After we take into account the need to stay compatible with older versions of the compiler (and other compilers), I don't think adding __attribute__((fallthrough)), even as a macro, is worth the trouble. It sticks out too much, a comment is just as good. But gcc has some very specific requiremnts how the comment should look. Adjust it the specific form that it likes. I don't think the extra stuff we had in those comments was adding much value. (Note: the documentation seems to be wrong, and seems to describe a different pattern from the one that is actually used. I guess either the docs or the code will have to change before gcc 7 is finalized.)
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/siphash24.c7
-rw-r--r--src/basic/time-util.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/basic/siphash24.c b/src/basic/siphash24.c
index 8c1cdc3db6..4bb41786c8 100644
--- a/src/basic/siphash24.c
+++ b/src/basic/siphash24.c
@@ -127,18 +127,25 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) {
switch (left) {
case 7:
state->padding |= ((uint64_t) in[6]) << 48;
+ /* fall through */
case 6:
state->padding |= ((uint64_t) in[5]) << 40;
+ /* fall through */
case 5:
state->padding |= ((uint64_t) in[4]) << 32;
+ /* fall through */
case 4:
state->padding |= ((uint64_t) in[3]) << 24;
+ /* fall through */
case 3:
state->padding |= ((uint64_t) in[2]) << 16;
+ /* fall through */
case 2:
state->padding |= ((uint64_t) in[1]) << 8;
+ /* fall through */
case 1:
state->padding |= ((uint64_t) in[0]);
+ /* fall through */
case 0:
break;
}
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index 7a5b29d77e..1310c76336 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -1271,7 +1271,7 @@ bool clock_supported(clockid_t clock) {
if (!clock_boottime_supported())
return false;
- /* fall through, after checking the cached value for CLOCK_BOOTTIME. */
+ /* fall through */
default:
/* For everything else, check properly */