All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prasad Sodagudi <psodagud@codeaurora.org>
To: gregkh@linuxfoundation.org, segher@kernel.crashing.org,
	ghackmann@google.com, yamada.masahiro@socionext.com
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Prasad Sodagudi <psodagud@codeaurora.org>
Subject: [PATCH] kbuild: clang: Disable -Wunused-const-variable warnings
Date: Mon, 29 Jan 2018 09:08:00 -0800	[thread overview]
Message-ID: <1517245680-3361-1-git-send-email-psodagud@codeaurora.org> (raw)
In-Reply-To: <fd6fdda6c0080e72598eabd2c88d7df6@codeaurora.org>

Currently -Wunused-variable warnings are disabled with
clang and with gcc -Wunused-variable warnings are
enabled, with this setting all unused local variables
would be warned in clang as well.

Disable -Wunused-const-variable warnings instead of
disabling -Wunused-variable warnings, So that in both
clang and GCC -Wunused-const-variable gets disabled.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 339397b..4b6c8e2 100644
--- a/Makefile
+++ b/Makefile
@@ -698,7 +698,6 @@ KBUILD_CFLAGS += $(stackp-flag)
 
 ifeq ($(cc-name),clang)
 KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
-KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
 KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
 KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
@@ -716,9 +715,9 @@ else
 # These warnings generated too much noise in a regular build.
 # Use make W=1 to enable them (see scripts/Makefile.extrawarn)
 KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
-KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
 endif
 
+KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
 else
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project

  reply	other threads:[~2018-01-29 17:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 21:24 unused-variable warning is getting disabled with clang Sodagudi Prasad
2017-12-07  6:26 ` Greg Kroah-Hartman
2017-12-08  2:16   ` Sodagudi Prasad
2017-12-18 15:32     ` Masahiro Yamada
2018-01-27  0:59       ` [PATCH] kbuild: clang: Disable -Wunused-const-variable warnings Prasad Sodagudi
2018-01-28 16:22         ` Segher Boessenkool
2018-01-29 16:35           ` Sodagudi Prasad
2018-01-29 17:08             ` Prasad Sodagudi [this message]
2018-01-29 23:57               ` Segher Boessenkool
2018-02-02 16:01               ` Masahiro Yamada
2018-02-06 23:46                 ` [PATCH] kbuild: clang: disable unused variable warnings only when constant Prasad Sodagudi
2018-02-07  0:22                   ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517245680-3361-1-git-send-email-psodagud@codeaurora.org \
    --to=psodagud@codeaurora.org \
    --cc=ghackmann@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=segher@kernel.crashing.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.