From patchwork Mon Jul 7 10:53:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 4494431 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D3F65BEEAA for ; Mon, 7 Jul 2014 10:53:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA800202A1 for ; Mon, 7 Jul 2014 10:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8EEB20225 for ; Mon, 7 Jul 2014 10:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbaGGKxn (ORCPT ); Mon, 7 Jul 2014 06:53:43 -0400 Received: from mail.skyhub.de ([78.46.96.112]:48941 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbaGGKxm (ORCPT ); Mon, 7 Jul 2014 06:53:42 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1404730420; bh=ytvvFShKz3JHsFnWfvcMJI355xRceWaD2oT6kJjKFA0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=Vq2c/ko/kRytdE/aVLK6GQgdwB3mJQKGFT8l0s hO7DlKuAHh3LS+Wz/UVP+ng6pNLJtk6/lDcUazaViRkt+mIWSDj2bQu1BAeVXjkOFAY Ethzg+gMa6vF/JeysLD0iw0Y8Npq8/B8C54evaqu7KEKVN8cq+hojwhsdAwpWw5sVY= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0u6OjTuCDehF; Mon, 7 Jul 2014 12:53:40 +0200 (CEST) Received: from liondog.tnic (p5DDC4A59.dip0.t-ipconnect.de [93.220.74.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 0C4CF1DA273; Mon, 7 Jul 2014 12:53:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1404730420; bh=ytvvFShKz3JHsFnWfvcMJI355xRceWaD2oT6kJjKFA0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=Vq2c/ko/kRytdE/aVLK6GQgdwB3mJQKGFT8l0s hO7DlKuAHh3LS+Wz/UVP+ng6pNLJtk6/lDcUazaViRkt+mIWSDj2bQu1BAeVXjkOFAY Ethzg+gMa6vF/JeysLD0iw0Y8Npq8/B8C54evaqu7KEKVN8cq+hojwhsdAwpWw5sVY= Received: by liondog.tnic (Postfix, from userid 1000) id 47AC4101B82; Mon, 7 Jul 2014 12:53:39 +0200 (CEST) Date: Mon, 7 Jul 2014 12:53:39 +0200 From: Borislav Petkov To: Sam Ravnborg Cc: lkml , Michael Matz , linux-kbuild@vger.kernel.org, x86-ml Subject: Re: [PATCH] Kbuild: Move -Wmaybe-uninitialized to W=1 Message-ID: <20140707105339.GA4776@pd.tnic> References: <20140616132045.GE8170@pd.tnic> <20140616211405.GA7914@ravnborg.org> <20140624213835.GD15068@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140624213835.GD15068@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ok, here's a v2 which goes ontop of http://lkml.kernel.org/r/1404175346-12330-1-git-send-email-behanw@converseincode.com After this, all warnings stuff should be back to normal. --- From: Borislav Petkov Subject: [PATCH -v2] Kbuild: Move -Wmaybe-uninitialized to W=1 This warning is enabled by -Wall or -Wextra, says the gcc manpage. It also says that gcc cannot always know whether the warning is issued correctly: "These warnings are made optional because GCC is not smart enough to see all the reasons why the code might be correct in spite of appearing to have an error." And, as expected, it fires for perfectly valid use cases, thus making it not really useful. Let's move it to the W=1 bunch in case people want to enable it with the additional checks. Signed-off-by: Borislav Petkov --- Makefile | 5 ++++- scripts/Makefile | 1 + scripts/Makefile.extrawarn | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4d75b4bceedd..b58c94261960 100644 --- a/Makefile +++ b/Makefile @@ -613,7 +613,7 @@ include $(srctree)/arch/$(SRCARCH)/Makefile KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += -Os else KBUILD_CFLAGS += -O2 endif @@ -742,6 +742,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) # use the deterministic mode of AR if available KBUILD_ARFLAGS := $(call ar-option,D) +# disable -Wmaybe-uninitialized as too noisy, see Makefile.extrawarn instead +KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) + # check for 'asm goto' ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO diff --git a/scripts/Makefile b/scripts/Makefile index 890df5c6adfb..a483d9988a2e 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -19,6 +19,7 @@ hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable hostprogs-$(CONFIG_ASN1) += asn1_compiler HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include +HOSTCFLAGS_sortextable.o += $(call cc-disable-warning, maybe-uninitialized) HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include always := $(hostprogs-y) $(hostprogs-m) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index e3501272cd93..9657d5778e06 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition warning-1 += $(call cc-option, -Wmissing-include-dirs) warning-1 += $(call cc-option, -Wunused-but-set-variable) warning-1 += $(call cc-disable-warning, missing-field-initializers) +warning-1 += $(call cc-option, -Wmaybe-uninitialized) ifeq ($(COMPILER),clang) warning-1 += $(call cc-disable-warning, initializer-overrides)