diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-01-27 00:50:10 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-01-31 14:04:55 -0500 |
commit | ec251fe7d5bc24b5d38b0853bc5969f3a0ba06e2 (patch) | |
tree | c37bae4fdc7a54ebbe6abcb394a6019efc619c61 /src/core | |
parent | 9ce6d1b319f8655100af6ecf5fd57e4558d57dd1 (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/core')
-rw-r--r-- | src/core/socket.c | 1 | ||||
-rw-r--r-- | src/core/timer.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 3cae6b31bb..a7b9ada65c 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -2668,6 +2668,7 @@ const char* socket_port_type_to_string(SocketPort *p) { if (socket_address_family(&p->address) == AF_NETLINK) return "Netlink"; + /* fall through */ default: return NULL; } diff --git a/src/core/timer.c b/src/core/timer.c index c6b28dd9c5..5ee14669d2 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -422,7 +422,8 @@ static void timer_enter_waiting(Timer *t, bool initial) { } /* In a container we don't want to include the time the host * was already up when the container started, so count from - * our own startup. Fall through. */ + * our own startup. */ + /* fall through */ case TIMER_STARTUP: base = UNIT(t)->manager->userspace_timestamp.monotonic; break; |