Re: [PATCH] Fixes compile warning with -Wimplicit-fallthrough CFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 22, 2018 at 6:51 PM, Elia Pinto <gitter.spiros@xxxxxxxxx> 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 <gitter.spiros@xxxxxxxxx>
> ---
> 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:



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux