linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>, 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, 1 Mar 2013 16:51:24 +0100	[thread overview]
Message-ID: <CA+icZUUCRb9DafSj0Vhtq68mNxBPHVpSkeau+UEkfVb3Jv0k6g@mail.gmail.com> (raw)
In-Reply-To: <201302152005.51575.arnd@arndb.de>

[-- Attachment #1: Type: text/plain, Size: 3020 bytes --]

On Fri, Feb 15, 2013 at 9:05 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 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

I have seen a lot of such failures when using the Freetz (a small
router project) build-system with gcc-4.7-x where "-Os" is default
optimization-level.

Last, when I tried to integrate ltrace GIT snapshots into Freetz.
All these "build-errors" could be solved in changing ltrace code.
So, I would not talk about "false positives".

Furthermore, "-Wno-maybe-uninitialized" gcc-option is available
gcc-4-7+, so your patch is incomplete.
Setting it is a "workaround" and a bit rough to stop compilation.
Here, I have it only activated for ltrace compilation.

I am attaching my ltrace.mk file for Freetz.

Greetings from Tuebingen to Tuebingen,
- Sedat -

[ ltrace.mk ]
...
# Set compiler options to suppress warnings treated as errors
# Reference: gcc manual chapter "3.8 Options to Request or Suppress Warnings"
# <http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options>
# EXAMPLE: TARGET_CC_OPTS := -Wno-error=maybe-uninitialized (here: gcc-4.7)
ifneq (,$(strip $(filter 4.7,$(TARGET_TOOLCHAIN_GCC_MAJOR_VERSION))))
TARGET_CC_OPTS := -Wno-error=maybe-uninitialized
else
TARGET_CC_OPTS :=
endif
...
- EOT -

[-- Attachment #2: ltrace.mk --]
[-- Type: application/octet-stream, Size: 3394 bytes --]

$(call PKG_INIT_BIN, 0.7.90-git)
$(PKG)_SOURCE:=ltrace-$($(PKG)_VERSION).tar.gz
# Comment MD5 as it differs for each downloaded tarball from upstream Git repository
#$(PKG)_SOURCE_MD5:=xxx
# XXX: Workaround: Generate a tarball from upstream Git repository (use 7 digits)
$(PKG)_GIT_VERSION:=bc0de43
$(PKG)_SITE:=http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=snapshot;h=$($(PKG)_GIT_VERSION);sf=tgz

$(PKG)_BINARY:=$($(PKG)_DIR)/ltrace
$(PKG)_CONF:=$($(PKG)_DIR)/etc/ltrace.conf
$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/ltrace
$(PKG)_TARGET_CONF:=$($(PKG)_DEST_DIR)/etc/ltrace.conf

$(PKG)_DEPENDS_ON := libelf

$(PKG)_REBUILD_SUBOPTS += FREETZ_PACKAGE_LTRACE_STATIC

# Copy original header files and regenerate them using mksyscallent_mips and mksignalent scripts
$(PKG)_CONFIGURE_PRE_CMDS += ( \
	cd sysdeps/linux-gnu/mips ; \
	cp syscallent.h syscallent.h.orig ; \
	cp signalent.h signalent.h.orig ; \
	../mksyscallent_mips $(TARGET_TOOLCHAIN_STAGING_DIR)/usr/include/asm/unistd.h > syscallent.h ; \
	../mksignalent $(TARGET_TOOLCHAIN_STAGING_DIR)/usr/include/asm/signal.h > signalent.h ; \
	);

# Use autogen.sh script to generate missing files like configure etc.
$(PKG)_CONFIGURE_PRE_CMDS += ./autogen.sh ;

# Disable demangling support
$(PKG)_CONFIGURE_ENV += ac_cv_lib_iberty_cplus_demangle=no
$(PKG)_CONFIGURE_ENV += ac_cv_lib_stdcpp___cxa_demangle=no
$(PKG)_CONFIGURE_ENV += ac_cv_lib_supcpp___cxa_demangle=no

$(PKG)_CONFIGURE_ENV += LD="$(TARGET_LD)"

# Set compiler options to suppress warnings treated as errors
# Reference: gcc manual chapter "3.8 Options to Request or Suppress Warnings"
# <http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options>
# EXAMPLE: TARGET_CC_OPTS := -Wno-error=maybe-uninitialized (here: gcc-4.7)
ifneq (,$(strip $(filter 4.7,$(TARGET_TOOLCHAIN_GCC_MAJOR_VERSION))))
TARGET_CC_OPTS := -Wno-error=maybe-uninitialized
else
TARGET_CC_OPTS :=
endif

# XXX: Workaround: Download Git tarball (replaces $(PKG_SOURCE_DOWNLOAD))
$(DL_DIR)/$(LTRACE_SOURCE): | $(DL_DIR)
	wget -O $(DL_DIR)/$(LTRACE_SOURCE) "$(LTRACE_SITE)"

$(pkg)-download: $(DL_DIR)/$(LTRACE_SOURCE)

# XXX: Workaround: Unpack Git tarball and apply patches (replaces $(PKG_UNPACKED))
$($(PKG)_DIR)/.unpacked: $(DL_DIR)/$(LTRACE_SOURCE) | $(SOURCE_DIR)
	mkdir -p $(LTRACE_DIR)
	tar -C $(LTRACE_DIR) $(VERBOSE) --strip-components=1 \
		-xf $(DL_DIR)/$(LTRACE_SOURCE)
	for i in $(LTRACE_MAKE_DIR)/patches/*.patch; do \
		$(PATCH_TOOL) $(LTRACE_DIR) $$i; \
	done;
	touch $@

$(pkg)-unpacked: $($(PKG)_DIR)/.unpacked

# XXX: Workaround: Commented due to switch to Git tarball usage
#$(PKG_SOURCE_DOWNLOAD)
#$(PKG_UNPACKED)
$(PKG_CONFIGURED_CONFIGURE)

$($(PKG)_CONF): $($(PKG)_DIR)/.unpacked

$($(PKG)_TARGET_CONF): $($(PKG)_CONF)
	mkdir -p $(dir $@)
	cp $< $@

$($(PKG)_BINARY): $($(PKG)_DIR)/.configured
	$(SUBMAKE) -C $(LTRACE_DIR) \
		ARCH="$(KERNEL_ARCH)" \
		CFLAGS="$(TARGET_CFLAGS) $(TARGET_CC_OPTS)" \
		$(if $(FREETZ_PACKAGE_LTRACE_STATIC),LDFLAGS="-all-static")

$($(PKG)_TARGET_BINARY): $($(PKG)_BINARY)
	$(INSTALL_BINARY_STRIP)

$(pkg):

$(pkg)-precompiled: $($(PKG)_TARGET_BINARY) $($(PKG)_TARGET_CONF)

$(pkg)-clean:
	-$(SUBMAKE) -C $(LTRACE_DIR) clean

$(pkg)-uninstall:
	$(RM) $(LTRACE_TARGET_BINARY)
	$(RM) $(LTRACE_TARGET_CONF)

.PHONY: $(pkg)-download $(pkg)-unpacked $(pkg) $(pkg)-precompiled $(pkg)-clean $(pkg)-uninstall

$(PKG_FINISH)

  reply	other threads:[~2013-03-01 15:51 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
2013-03-01 15:51     ` Sedat Dilek [this message]
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=CA+icZUUCRb9DafSj0Vhtq68mNxBPHVpSkeau+UEkfVb3Jv0k6g@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=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).