blob: 16fdefbbd1c6e960d49060dc168fddc4c349df53 [file] [log] [blame]
Patrick Williams44b3caf2024-04-12 16:51:14 -05001From c29d086714b49a6d76ccca83b4a6fa2f139bad6e 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---
Patrick Williams44b3caf2024-04-12 16:51:14 -050013 Makefile | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015
16diff --git a/Makefile b/Makefile
Patrick Williams44b3caf2024-04-12 16:51:14 -050017index 7bfd336..9ab6a65 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018--- a/Makefile
19+++ b/Makefile
Patrick Williams44b3caf2024-04-12 16:51:14 -050020@@ -56,21 +56,21 @@ CWFLAGS += -Wp -O3
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021 endif
22
Patrick Williams44b3caf2024-04-12 16:51:14 -050023 ifeq ($(origin FALLTHROUGH), undefined)
24- FALLTHROUGH := $(shell gcc -Q --help=warnings 2>&1 | grep "implicit-fallthrough" | wc -l)
25+ FALLTHROUGH := $(shell ${CC} -Q --help=warnings 2>&1 | grep "implicit-fallthrough" | wc -l)
26 ifneq "$(FALLTHROUGH)" "0"
27 CWFLAGS += -Wimplicit-fallthrough=0
28 endif
Brad Bishopd7bf8c12018-02-25 22:55:05 -050029 endif
Patrick Williams44b3caf2024-04-12 16:51:14 -050030
31 ifeq ($(origin FORMATOVERFLOW), undefined)
32- FORMATOVERFLOW := $(shell gcc -Q --help=warnings 2>&1 | grep "format-overflow" | wc -l)
33+ FORMATOVERFLOW := $(shell ${CC} -Q --help=warnings 2>&1 | grep "format-overflow" | wc -l)
34 ifneq "$(FORMATOVERFLOW)" "0"
35 CWFLAGS += -Wformat-overflow
36 endif
37 endif
38
39 ifeq ($(origin STRINGOPOVERFLOW), undefined)
40- STRINGOPOVERFLOW := $(shell gcc -Q --help=warnings 2>&1 | grep "stringop-overflow" | wc -l)
41+ STRINGOPOVERFLOW := $(shell ${CC} -Q --help=warnings 2>&1 | grep "stringop-overflow" | wc -l)
42 ifneq "$(STRINGOPOVERFLOW)" "0"
43 CWFLAGS += -Wstringop-overflow
44 endif