linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Greg KH <greg@kroah.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Stevenson <david@avoncliff.com>
Subject: Re: linux-next: build warning after merge of the char-misc tree
Date: Fri, 15 Feb 2013 20:05:51 +0000	[thread overview]
Message-ID: <201302152005.51575.arnd@arndb.de> (raw)
In-Reply-To: <20130215173429.GA27707@kroah.com>

On Friday 15 February 2013, Greg KH wrote:
> On Fri, Feb 15, 2013 at 04:26:57PM +1100, Stephen Rothwell wrote:
> > 
> > After merging the char-misc tree, today's linux-next build (x86_64
> > allmodconfig) produced this warning:
> > 
> > drivers/w1/slaves/w1_therm.c: In function 'w1_therm_read':
> > drivers/w1/slaves/w1_therm.c:245:15: warning: 'crc' may be used uninitialized in this function [-Wuninitialized]
> > 
> > Its a false positive, but it was introduced by commit 867ff9880d5d
> > ("w1_therm: Retries: remove old code add CRC")
> 
> I don't see that here with gcc 4.7.1, perhaps you need to upgrade your
> version of gcc to not show these false positives?

I have finally put the pieces of the puzzle together. I already knew
that some of these warnings only happen when building with -Os (even
in gcc-4.8), since gcc turns off the inlining at a point after it
determines that the variable might be used uninitialized but before
determining that it's actually isn't.

I think the best way forward is to disable this particular warning
when building with -Os (which is enabled in allyesconfig). A false
positive seems more harmful than a false negative here, because it
prompts people to add broken initializations. This patch indeed
makes the majority of the allyesconfig warnings on ARM go away.
For the regular defconfig builds, we are already mostly clean,
and those are built with -O2.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/Makefile b/Makefile
index 0b4bf62..4d60d97 100644
--- a/Makefile
+++ b/Makefile
@@ -570,7 +570,7 @@ endif # $(dot-config)
 all: vmlinux
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS	+= -Os
+KBUILD_CFLAGS	+= -Os $(call cc-option,-Wno-maybe-uninitialized,)
 else
 KBUILD_CFLAGS	+= -O2
 endif

  parent reply	other threads:[~2013-02-15 20:06 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15  5:26 linux-next: build warning after merge of the char-misc tree Stephen Rothwell
2013-02-15 17:34 ` Greg KH
2013-02-15 18:07   ` Arnd Bergmann
2013-02-15 20:05   ` Arnd Bergmann [this message]
2013-03-01 15:51     ` Sedat Dilek
2013-03-01 17:16       ` Arnd Bergmann
2013-03-01 17:43         ` Sedat Dilek
2015-03-27  7:48 Stephen Rothwell
2015-03-31 19:35 ` Fabian Frederick
2015-04-03 14:05   ` Greg KH
2017-03-28  3:31 Stephen Rothwell
2017-03-28  3:58 ` Masahiro Yamada
2017-07-20  4:12 Stephen Rothwell
2017-07-20  5:13 ` Greg KH
2017-07-20 14:52   ` KY Srinivasan
2017-07-20  9:14 ` Greg KH
2017-12-12  3:39 Stephen Rothwell
2017-12-12 11:49 ` Greg KH
2018-10-02  5:31 Stephen Rothwell
2018-10-02  8:34 ` Bartosz Golaszewski
2018-10-02  9:12 Stephen Rothwell
2018-10-02  9:49 ` Bartosz Golaszewski
2018-10-02  9:56   ` Srinivas Kandagatla
2018-10-02 10:04     ` Bartosz Golaszewski
2019-04-26  5:56 Stephen Rothwell
2019-04-26  6:25 ` Greg KH
2019-04-26 14:30   ` Patrick Venture
2019-04-26 18:00     ` Patrick Venture
2020-05-01  6:28 Stephen Rothwell
2020-05-01  6:55 ` Greg KH
2020-05-01 10:17   ` Rajan Vaja
2021-01-29  7:07 Stephen Rothwell
2021-04-06 11:44 Stephen Rothwell
2021-04-06 11:46 ` Stephen Rothwell
2021-04-06 14:07 ` Greg KH
2021-04-06 14:13   ` Gustavo Pimentel
2021-04-06 14:15     ` Greg KH
2021-04-06 17:28       ` Gustavo Pimentel
2021-04-06 17:33         ` Greg KH
2021-05-24  6:19 Stephen Rothwell
2022-07-15 11:43 Stephen Rothwell
2024-04-15  5:22 Stephen Rothwell
2024-04-15  7:21 ` Greg KH

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=201302152005.51575.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=david@avoncliff.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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).