diff options
Diffstat (limited to 'meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch')
-rw-r--r-- | meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch b/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch new file mode 100644 index 0000000000..ce15170c75 --- /dev/null +++ b/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xiao Ni <xni@redhat.com> | ||
3 | Date: Fri, 17 Mar 2017 19:55:42 +0800 | ||
4 | Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile | ||
5 | |||
6 | There are many errors like 'error: this statement may fall through'. | ||
7 | But the logic is right. So add the flag Wimplicit-fallthrough=0 | ||
8 | to disable the error messages. The method I use is from | ||
9 | https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html | ||
10 | #index-Wimplicit-fallthrough-375 | ||
11 | |||
12 | Signed-off-by: Xiao Ni <xni@redhat.com> | ||
13 | Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> | ||
14 | --- | ||
15 | Upstream-Status: Backport | ||
16 | Makefile | 5 +++++ | ||
17 | 1 file changed, 5 insertions(+) | ||
18 | |||
19 | diff --git a/Makefile b/Makefile | ||
20 | index 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 | -- | ||
36 | 2.12.2 | ||
37 | |||