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>
This commit is contained in:
Xiao Ni 2017-03-17 19:55:42 +08:00 committed by Jes Sorensen
parent 72b616aff2
commit 8268821b43
1 changed files with 5 additions and 0 deletions

View File

@ -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