linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, linux-kbuild@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-sparse@vger.kernel.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>
Subject: [PATCH 1/3] kbuild: Add -Wshadow to sparse
Date: Wed, 17 Oct 2018 19:05:52 +0200	[thread overview]
Message-ID: <20181017170554.18841-2-bigeasy@linutronix.de> (raw)
In-Reply-To: <20181017170554.18841-1-bigeasy@linutronix.de>

I remember that `sparse' used to warn about shadowed variables but it
seems not to do it by default anymore. It was useful.

Enable `-Wshadow' while invoking sparse.

Cc: linux-sparse@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index bf3786e4ffece..0160c6b5dd45d 100644
--- a/Makefile
+++ b/Makefile
@@ -390,7 +390,7 @@ PYTHON3		= python3
 CHECK		= sparse
 
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-		  -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
+		  -Wbitwise -Wno-return-void -Wno-unknown-attribute -Wshadow $(CF)
 NOSTDINC_FLAGS  =
 CFLAGS_MODULE   =
 AFLAGS_MODULE   =
-- 
2.19.1


  reply	other threads:[~2018-10-17 17:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 17:05 [PATCH 0/3] Let sparse check for shadowed variables Sebastian Andrzej Siewior
2018-10-17 17:05 ` Sebastian Andrzej Siewior [this message]
2018-10-17 19:25   ` [PATCH 1/3] kbuild: Add -Wshadow to sparse Luc Van Oostenryck
2018-10-17 20:13     ` Sebastian Andrzej Siewior
2018-10-17 17:05 ` [PATCH 2/3] x86/mcelog: Remove one mce_helper definition Sebastian Andrzej Siewior
2018-10-17 17:10   ` Borislav Petkov
2018-10-17 18:22     ` Thomas Gleixner
2018-10-17 22:12   ` [tip:ras/core] " tip-bot for Sebastian Andrzej Siewior
2018-10-17 17:05 ` [PATCH 3/3] kvm: don't redefine flags as something else Sebastian Andrzej Siewior
2018-10-17 17:06   ` Paolo Bonzini
2019-03-13  8:58     ` Sebastian Andrzej Siewior
2019-03-13 11:06       ` Paolo Bonzini

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=20181017170554.18841-2-bigeasy@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).