From patchwork Tue Jun 24 21:38:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 4414241 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C7D799F1D6 for ; Tue, 24 Jun 2014 21:38:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0291F20304 for ; Tue, 24 Jun 2014 21:38:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F2B52034B for ; Tue, 24 Jun 2014 21:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752787AbaFXVij (ORCPT ); Tue, 24 Jun 2014 17:38:39 -0400 Received: from mail.skyhub.de ([78.46.96.112]:38447 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbaFXVii (ORCPT ); Tue, 24 Jun 2014 17:38:38 -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=1403645917; bh=UCKej7aMudJSf4WZaSQyx2FRNpgvBr40HQQ5w50A2pw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=fUiSQ6LrTIPcTp+bVezD8TG00rZ4D8uYDA/uw5 yU4UpMFcI8+9vZUo7v14F392vBKeAIEzfH0NKBxkq7R3AdyWziBSfgwaQje2dbCUzZU GRPUbQ1b2eIOLNyPqNEF6GnZejGthyp8G8kww0RBoJlFYFyg/BBmExuXvI43BkhG8w= 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 OaZeR001LCIA; Tue, 24 Jun 2014 23:38:37 +0200 (CEST) Received: from liondog.tnic (p5DDC6824.dip0.t-ipconnect.de [93.220.104.36]) (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 C87301DA27B; Tue, 24 Jun 2014 23:38:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1403645917; bh=UCKej7aMudJSf4WZaSQyx2FRNpgvBr40HQQ5w50A2pw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=fUiSQ6LrTIPcTp+bVezD8TG00rZ4D8uYDA/uw5 yU4UpMFcI8+9vZUo7v14F392vBKeAIEzfH0NKBxkq7R3AdyWziBSfgwaQje2dbCUzZU GRPUbQ1b2eIOLNyPqNEF6GnZejGthyp8G8kww0RBoJlFYFyg/BBmExuXvI43BkhG8w= Received: by liondog.tnic (Postfix, from userid 1000) id 2BA3C10175A; Tue, 24 Jun 2014 23:38:35 +0200 (CEST) Date: Tue, 24 Jun 2014 23:38:35 +0200 From: Borislav Petkov To: Sam Ravnborg Cc: lkml , Michael Matz , linux-kbuild@vger.kernel.org, x86-ml Subject: [PATCH] Kbuild: Move -Wmaybe-uninitialized to W=1 Message-ID: <20140624213835.GD15068@pd.tnic> References: <20140616132045.GE8170@pd.tnic> <20140616211405.GA7914@ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140616211405.GA7914@ravnborg.org> 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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 On Mon, Jun 16, 2014 at 11:14:05PM +0200, Sam Ravnborg wrote: > Agreed. > The noise ratio is too high - so move it to W=1. Ok, how about the below? It still needs this hunk to work: @@ -33,7 +34,7 @@ warning-1 += $(call cc-disable-warning, format) warning-1 += $(call cc-disable-warning, unknown-warning-option) warning-1 += $(call cc-disable-warning, sign-compare) warning-1 += $(call cc-disable-warning, format-zero-length) -warning-1 += $(call cc-disable-warning, uninitialized) +#warning-1 += $(call cc-disable-warning, uninitialized) warning-1 += $(call cc-option, -fcatch-undefined-behavior) warning-2 := -Waggregate-return but that's another story which is still WIP here: http://lkml.kernel.org/r/20140616130751.GD8170@pd.tnic After it is sorted out, we can do something like the below. (Note: I'm not filtering out the previous -Wno-maybe-uninitialized from KBUILD_CFLAGS because it is not necessary - apparently the following -Wmaybe-uninitialized reenables it again). --- From: Borislav Petkov Subject: [PATCH] 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 | 2 ++ scripts/Makefile.extrawarn | 1 + 2 files changed, 3 insertions(+) diff --git a/Makefile b/Makefile index b11e2d504a00..63033545d7f6 100644 --- a/Makefile +++ b/Makefile @@ -402,6 +402,8 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Werror-implicit-function-declaration \ -Wno-format-security +KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) + KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS := -D__ASSEMBLY__ diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 65643506c71c..e61678c40d41 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) # Clang warning-1 += $(call cc-disable-warning, initializer-overrides)