From: Dave Jones <davej@redhat.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Joe Perches <joe@perches.com>,
David Daney <ddaney@caviumnetworks.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
BorislavPetkov <bp@alien8.de>
Subject: Re: annoying new gcc 4.6.0 warnings.
Date: Thu, 21 Apr 2011 16:27:14 -0400 [thread overview]
Message-ID: <20110421202713.GA19425@redhat.com> (raw)
In-Reply-To: <20110421200836.GA31709@merkur.ravnborg.org>
On Thu, Apr 21, 2011 at 10:08:36PM +0200, Sam Ravnborg wrote:
> My gcc (4.3.2) barfed over -Wno-unused-but-set-variable.
> So your patch needs to check if the option is supported.
I don't have a gcc older than 4.4.0. Can you try this ?
Dave
--
Disable the new -Wunused-but-set-variable that was added in gcc 4.6.0
It produces more false positives than useful warnings.
This can still be enabled using W=1
Signed-off-by: Dave Jones <davej@redhat.com>
diff --git a/Makefile b/Makefile
index b967b96..29e16f2 100644
--- a/Makefile
+++ b/Makefile
@@ -559,6 +559,8 @@ ifndef CONFIG_CC_STACKPROTECTOR
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
endif
+KBUILD_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable)
+
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d5f925a..30627ab 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -79,6 +79,7 @@ KBUILD_EXTRA_WARNINGS += -Wpointer-arith
KBUILD_EXTRA_WARNINGS += -Wredundant-decls
KBUILD_EXTRA_WARNINGS += -Wshadow
KBUILD_EXTRA_WARNINGS += -Wswitch-default
+KBUILD_EXTRA_WARNINGS += -Wunused-but-set-variable
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,)
KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS)
endif
next prev parent reply other threads:[~2011-04-21 20:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 19:21 annoying new gcc 4.6.0 warnings Dave Jones
2011-04-21 19:24 ` Linus Torvalds
2011-04-21 19:39 ` David Daney
2011-04-21 19:44 ` Joe Perches
2011-04-21 19:58 ` Dave Jones
2011-04-21 20:08 ` Sam Ravnborg
2011-04-21 20:27 ` Dave Jones [this message]
2011-04-21 20:37 ` David Daney
2011-04-21 20:45 ` Dave Jones
2011-04-21 20:56 ` Sam Ravnborg
2011-04-21 21:28 ` Dave Jones
2011-04-21 21:42 ` Sam Ravnborg
2011-04-29 15:02 ` Michal Marek
2011-04-21 20:09 ` Linus Torvalds
2011-04-21 20:15 ` Dave Jones
2011-04-21 20:30 ` Stratos Psomadakis
2011-04-21 21:10 ` Sam Ravnborg
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=20110421202713.GA19425@redhat.com \
--to=davej@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=ddaney@caviumnetworks.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
/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