Re: [PATCH] Fixes compile warning with -Wimplicit-fallthrough CFLAGS
On Mon, Jan 22, 2018 at 6:51 PM, Elia Pinto <gitter.spiros@gmail.com> wrote:
Show 17 quoted lines
> 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 <gitter.spiros@gmail.com>
> ---
> 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: