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]

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-xvthlvmhzfnt7jx73jgmaea1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 277d6f1d
...@@ -32,7 +32,6 @@ EXTRA_WARNINGS += -Wold-style-definition ...@@ -32,7 +32,6 @@ EXTRA_WARNINGS += -Wold-style-definition
EXTRA_WARNINGS += -Wpacked EXTRA_WARNINGS += -Wpacked
EXTRA_WARNINGS += -Wredundant-decls EXTRA_WARNINGS += -Wredundant-decls
EXTRA_WARNINGS += -Wshadow EXTRA_WARNINGS += -Wshadow
EXTRA_WARNINGS += -Wstrict-aliasing=3
EXTRA_WARNINGS += -Wstrict-prototypes EXTRA_WARNINGS += -Wstrict-prototypes
EXTRA_WARNINGS += -Wswitch-default EXTRA_WARNINGS += -Wswitch-default
EXTRA_WARNINGS += -Wswitch-enum EXTRA_WARNINGS += -Wswitch-enum
...@@ -40,6 +39,10 @@ EXTRA_WARNINGS += -Wundef ...@@ -40,6 +39,10 @@ EXTRA_WARNINGS += -Wundef
EXTRA_WARNINGS += -Wwrite-strings EXTRA_WARNINGS += -Wwrite-strings
EXTRA_WARNINGS += -Wformat EXTRA_WARNINGS += -Wformat
ifneq ($(CC), clang)
EXTRA_WARNINGS += -Wstrict-aliasing=3
endif
ifneq ($(findstring $(MAKEFLAGS), w),w) ifneq ($(findstring $(MAKEFLAGS), w),w)
PRINT_DIR = --no-print-directory PRINT_DIR = --no-print-directory
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册