From c4579930a9961da68fe9e07594a9f893f11b83d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Tue, 5 Sep 2017 14:35:13 +0200 Subject: [PATCH] Fix warnings 'implicit-fallthrough' of gcc 7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I32b42fd8db481fcbdce4b934fc990c118293850d Signed-off-by: José Bollo --- src/afm-launch.c | 1 + src/afm-system-daemon.c | 2 ++ src/mustach.c | 1 + src/wgtpkg-mustach.c | 8 ++++---- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/afm-launch.c b/src/afm-launch.c index d80e43b..1a354a1 100644 --- a/src/afm-launch.c +++ b/src/afm-launch.c @@ -610,6 +610,7 @@ static union arguments instantiate_arguments( break; case '%': c = 0; + /*@fallthrough@*/ default: mini[1] = c; v = mini; diff --git a/src/afm-system-daemon.c b/src/afm-system-daemon.c index 49749bc..e0557f4 100644 --- a/src/afm-system-daemon.c +++ b/src/afm-system-daemon.c @@ -103,6 +103,7 @@ static void on_install(struct sd_bus_message *smsg, struct json_object *req, voi reload = j_boolean_at(req, "reload", 1); break; } + /*@fallthrough@*/ default: jbus_reply_error_s(smsg, error_bad_request); return; @@ -150,6 +151,7 @@ static void on_uninstall(struct sd_bus_message *smsg, struct json_object *req, v root = j_string_at(req, "root", rootdir); break; } + /*@fallthrough@*/ default: jbus_reply_error_s(smsg, error_bad_request); return; diff --git a/src/mustach.c b/src/mustach.c index 03f3cb1..9868cff 100644 --- a/src/mustach.c +++ b/src/mustach.c @@ -99,6 +99,7 @@ static int process(const char *template, struct mustach_itf *itf, void *closure, template++; } c = '&'; + /*@fallthrough@*/ case '^': case '#': case '/': diff --git a/src/wgtpkg-mustach.c b/src/wgtpkg-mustach.c index 45d94e8..4251427 100644 --- a/src/wgtpkg-mustach.c +++ b/src/wgtpkg-mustach.c @@ -62,8 +62,8 @@ static char *keyval(char *read, int isptr) } else { if (c == '\\') { switch (read[1]) { - case '\\': *write++ = c; - case '=': c = *++read; + case '\\': *write++ = c; /*@fallthrough@*/ + case '=': c = *++read; /*@fallthrough@*/ default: break; } } @@ -92,8 +92,8 @@ static char *first(char **name, int isptr) while (c && c != '/') { if (c == '~') { switch(read[1]) { - case '1': c = '/'; - case '0': read++; + case '1': c = '/'; /*@fallthrough@*/ + case '0': read++; /*@fallthrough@*/ default: break; } } -- 2.16.6