summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2017-03-17 12:55:42 +0100
committerJes Sorensen <Jes.Sorensen@gmail.com>2017-03-17 20:56:50 +0100
commit8268821b434d1308d083454fb681d80176cf352b (patch)
treed9ee48a656db6977ddc40b06953e2d791356787f
parentmdadm:add checking clustered bitmap in assemble mode (diff)
downloadmdadm-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--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a6f464c3..d1a6ac46 100644
--- a/Makefile
+++ b/Makefile
@@ -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