Skip to contentSkip to conversation

tools: Suppress request for warning options not existent in clang

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Feb 16, 2017

lore
Share & tools
lore
#0 lore raw
Commit-ID:  093b75ef5995ea35d7f6bdb6c7b32a42a1999813
Gitweb:     http://git.kernel.org/tip/093b75ef5995ea35d7f6bdb6c7b32a42a1999813
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 14 Feb 2017 10:34:35 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 14 Feb 2017 10:34:35 -0300

tools: Suppress request for warning options not existent in clang

To allow building with clang, avoiding:

error: unknown warning option '-Wstrict-aliasing=3'; did you mean '-Wstring-plus-int'? [-Werror,-Wunknown-warning-option]

---
 tools/scripts/Makefile.include | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/scripts/Makefile.include +4 -1
index 19edc1a..621578a 100644
@@ -32,7 +32,6 @@ EXTRA_WARNINGS += -Wold-style-definition
 EXTRA_WARNINGS += -Wpacked
 EXTRA_WARNINGS += -Wredundant-decls
 EXTRA_WARNINGS += -Wshadow
-EXTRA_WARNINGS += -Wstrict-aliasing=3
 EXTRA_WARNINGS += -Wstrict-prototypes
 EXTRA_WARNINGS += -Wswitch-default
 EXTRA_WARNINGS += -Wswitch-enum
@@ -40,6 +39,10 @@ EXTRA_WARNINGS += -Wundef
 EXTRA_WARNINGS += -Wwrite-strings
 EXTRA_WARNINGS += -Wformat
 
+ifneq ($(CC), clang)
+EXTRA_WARNINGS += -Wstrict-aliasing=3
+endif
+
 ifneq ($(findstring $(MAKEFLAGS), w),w)
 PRINT_DIR = --no-print-directory
 else