diff options
author | Xiao Ni <xni@redhat.com> | 2017-03-17 12:55:42 +0100 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-03-17 20:56:50 +0100 |
commit | 8268821b434d1308d083454fb681d80176cf352b (patch) | |
tree | d9ee48a656db6977ddc40b06953e2d791356787f | |
parent | mdadm:add checking clustered bitmap in assemble mode (diff) | |
download | mdadm-8268821b434d1308d083454fb681d80176cf352b.tar.xz mdadm-8268821b434d1308d083454fb681d80176cf352b.zip |
mdadm: Add Wimplicit-fallthrough=0 in Makefile
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
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
-rw-r--r-- | Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -48,6 +48,11 @@ ifdef WARN_UNUSED CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3 endif +FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l) +ifneq "$(FALLTHROUGH)" "0" +CWFLAGS += -Wimplicit-fallthrough=0 +endif + ifdef DEBIAN CPPFLAGS += -DDEBIAN endif |