blob: 12bf6a5920721ea342230c13479f9f3be65e1d18 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 37c35f94d9d95dbd2b5f8a919f5478be51453590 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 13 Oct 2017 10:27:34 -0700
4Subject: [PATCH] Use CC to check for implicit-fallthrough warning support
5
6This warning it new in gcc7 and in cross compile case
7its possible that build host gcc is version 7+ but the
8cross compile used for compiling mdadm is < version 7
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011Upstream-Status: Pending
Brad Bishop19323692019-04-05 15:28:33 -040012---
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013 Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/Makefile b/Makefile
Brad Bishop19323692019-04-05 15:28:33 -040017index 46bf57b..a075912 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018--- a/Makefile
19+++ b/Makefile
Brad Bishop19323692019-04-05 15:28:33 -040020@@ -53,7 +53,7 @@ ifdef WARN_UNUSED
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021 CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
22 endif
23
24-FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
25+FALLTHROUGH := $(shell ${CC} -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
26 ifneq "$(FALLTHROUGH)" "0"
27 CWFLAGS += -Wimplicit-fallthrough=0
28 endif