Blame SOURCES/mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch

b7f731
From 8268821b434d1308d083454fb681d80176cf352b Mon Sep 17 00:00:00 2001
b7f731
From: Xiao Ni <xni@redhat.com>
b7f731
Date: Fri, 17 Mar 2017 19:55:42 +0800
b7f731
Subject: [RHEL7.5 PATCH 009/169] mdadm: Add Wimplicit-fallthrough=0 in
b7f731
 Makefile
b7f731
b7f731
There are many errors like 'error: this statement may fall through'.
b7f731
But the logic is right. So add the flag Wimplicit-fallthrough=0
b7f731
to disable the error messages. The method I use is from
b7f731
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
b7f731
#index-Wimplicit-fallthrough-375
b7f731
b7f731
Signed-off-by: Xiao Ni <xni@redhat.com>
b7f731
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
b7f731
---
b7f731
 Makefile | 5 +++++
b7f731
 1 file changed, 5 insertions(+)
b7f731
b7f731
diff --git a/Makefile b/Makefile
b7f731
index a6f464c..d1a6ac4 100644
b7f731
--- a/Makefile
b7f731
+++ b/Makefile
b7f731
@@ -48,6 +48,11 @@ ifdef WARN_UNUSED
b7f731
 CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
b7f731
 endif
b7f731
 
b7f731
+FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
b7f731
+ifneq "$(FALLTHROUGH)"  "0"
b7f731
+CWFLAGS += -Wimplicit-fallthrough=0
b7f731
+endif
b7f731
+
b7f731
 ifdef DEBIAN
b7f731
 CPPFLAGS += -DDEBIAN
b7f731
 endif
b7f731
-- 
b7f731
2.7.4
b7f731