diff options
author | Sodagudi Prasad <psodagud@codeaurora.org> | 2018-02-06 18:46:51 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-02-06 19:20:19 -0500 |
commit | 0a5f41767444cc3b4fc5573921ab914b4f78baaa (patch) | |
tree | 626bf979c52f950d3ca284c4980fa1197f89f780 /Makefile | |
parent | 1b9eda2e4892cb373c7d4cf23439f357c8739e27 (diff) |
kbuild: clang: disable unused variable warnings only when constant
Currently, GCC disables -Wunused-const-variable, but not
-Wunused-variable, so warns unused variables if they are
non-constant.
While, Clang does not warn unused variables at all regardless of
the const qualifier because -Wno-unused-const-variable is implied
by the stronger option -Wno-unused-variable.
Disable -Wunused-const-variable instead of -Wunused-variable so that
GCC and Clang work in the same way.
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -700,7 +700,6 @@ KBUILD_CFLAGS += $(stackp-flag) | |||
700 | 700 | ||
701 | ifeq ($(cc-name),clang) | 701 | ifeq ($(cc-name),clang) |
702 | KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) | 702 | KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
703 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) | ||
704 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) | 703 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) |
705 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) | 704 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) |
706 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) | 705 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
@@ -718,9 +717,9 @@ else | |||
718 | # These warnings generated too much noise in a regular build. | 717 | # These warnings generated too much noise in a regular build. |
719 | # Use make W=1 to enable them (see scripts/Makefile.extrawarn) | 718 | # Use make W=1 to enable them (see scripts/Makefile.extrawarn) |
720 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | 719 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) |
721 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | ||
722 | endif | 720 | endif |
723 | 721 | ||
722 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | ||
724 | ifdef CONFIG_FRAME_POINTER | 723 | ifdef CONFIG_FRAME_POINTER |
725 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 724 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
726 | else | 725 | else |