blob: ce15170c758d931942add6ed129e15855879e186 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001
2From: Xiao Ni <xni@redhat.com>
3Date: Fri, 17 Mar 2017 19:55:42 +0800
4Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile
5
6There are many errors like 'error: this statement may fall through'.
7But the logic is right. So add the flag Wimplicit-fallthrough=0
8to disable the error messages. The method I use is from
9https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
10#index-Wimplicit-fallthrough-375
11
12Signed-off-by: Xiao Ni <xni@redhat.com>
13Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
14---
15Upstream-Status: Backport
16 Makefile | 5 +++++
17 1 file changed, 5 insertions(+)
18
19diff --git a/Makefile b/Makefile
20index 0f307ec..e1a7058 100644
21--- a/Makefile
22+++ b/Makefile
23@@ -48,6 +48,11 @@ ifdef WARN_UNUSED
24 CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
25 endif
26
27+FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
28+ifneq "$(FALLTHROUGH)" "0"
29+CWFLAGS += -Wimplicit-fallthrough=0
30+endif
31+
32 ifdef DEBIAN
33 CPPFLAGS += -DDEBIAN
34 endif
35--
362.12.2
37