All of lore.kernel.org
 help / color / mirror / Atom feed
From: jes.sorensen@gmail.com
To: Xiao Ni <xni@redhat.com>
Cc: linux-raid@vger.kernel.org, ncroxon@redhat.com
Subject: Re: [MDADM PATCH 1/2] Add Wimplicit-fallthrough=0 in Makefile
Date: Mon, 06 Mar 2017 15:30:43 -0500	[thread overview]
Message-ID: <wrfjh936m9l8.fsf@gmail.com> (raw)
In-Reply-To: <1488348766-31087-2-git-send-email-xni@redhat.com> (Xiao Ni's message of "Wed, 1 Mar 2017 14:12:45 +0800")

Xiao Ni <xni@redhat.com> writes:
> There are many errors like 'error: this statement may fall through'. 
> But the logic is right. So add the flag Wimplicit-fallthrough=0 
> to disable the error messages. The method I use is from 
> https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
> #index-Wimplicit-fallthrough-375
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index a6f464c..b9f52e0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -43,7 +43,7 @@ KLIBC_GCC = gcc -nostdinc -iwithprefix include
> -I$(KLIBC)/klibc/include -I$(KLIB
>  
>  CC ?= $(CROSS_COMPILE)gcc
>  CXFLAGS ?= -ggdb
> -CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
> +CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter -Wimplicit-fallthrough=0

Hi Xiao,

I am not sure how long -Wimplicit-fallthrough has existed. I want to
make sure we allow for this to compile with older compilers as well.

Could you please make it a check so this flag is only set if the version
of gcc supports it?

Thanks,
Jes



  reply	other threads:[~2017-03-06 20:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  6:12 [MDADM PATCH 0/2] Fix some building errors Xiao Ni
2017-03-01  6:12 ` [MDADM PATCH 1/2] Add Wimplicit-fallthrough=0 in Makefile Xiao Ni
2017-03-06 20:30   ` jes.sorensen [this message]
2017-03-01  6:12 ` [MDADM PATCH 2/2] Specify suitable size when write to buffer Xiao Ni
2017-03-06 21:21   ` jes.sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wrfjh936m9l8.fsf@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=xni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.