From: Eric Sunshine Date: Tue, 23 Jan 2018 00:54:18 GMT Subject: Re: [PATCH] Fixes compile warning with -Wimplicit-fallthrough CFLAGS Message-ID: In-Reply-To: <1516665078-107974-1-git-send-email-gitter.spiros@gmail.com> On Mon, Jan 22, 2018 at 6:51 PM, Elia Pinto wrote: > This patch add explicit fallthrough compiler attribute > when needed on switch case statement eliminating > the compile warning [-Werror=implicit-fallthrough=]. > It does this by means of a macro that takes into account > the versions of the compilers that include that attribute. > [...] > Signed-off-by: Elia Pinto > --- > diff --git a/convert.c b/convert.c > @@ -1554,7 +1554,7 @@ static int ident_filter_fn(struct stream_filter *filter, > switch (ident->state) { > default: > strbuf_add(&ident->left, head, ident->state); > - /* fallthrough */ > + GIT_FALLTHROUGH; > case IDENT_SKIPPING: > /* fallthrough */ Why doesn't this /* fallthrough */ deserve the same treatment? > case IDENT_DRAINING: