From patchwork Thu Mar 14 22:01:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2274041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B15F63FC8A for ; Thu, 14 Mar 2013 22:04:49 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UGGDa-00087s-5K; Thu, 14 Mar 2013 22:01:46 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UGGDU-00085D-5b for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2013 22:01:40 +0000 Received: from wuerfel.localnet (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MSmkD-1U8o5d3vq1-00RcsS; Thu, 14 Mar 2013 23:01:37 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] Turn off -Wmaybe-uninitialized when building with -Os Date: Thu, 14 Mar 2013 23:01:35 +0100 Message-ID: <7534695.eTHcH0enMV@wuerfel> User-Agent: KMail/4.10 rc3 (Linux/3.8.0-7-generic; KDE/4.10.0; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:qeUzYebeZl3+ZdfT2hbVrJpRC5jE7DSvr/5viXSw66J LeTlsCLCKdZvbt7RGOeNrug+QFC/eKXETkA+C9XlLhNiST19wT epF5jN/013fQF98Qz1VBbMnmRoJnJeobGgQtEiErijavozLhBh hHm4nXVheKgZnnt+iFLbtjJ9cm/TfOPIWuhrYg2OxzH3xVOJZi fw2EyDF24xp+Lq1CQRRgZjjdxcfL8ZRAOC7KyNiD2O/W89YUWr f4gJVua/k8cHQOdseYUNpDdppzOBDQ0fLMCTME+fw6PXOAKcxu w3Cgq6OU/sDlDGNOn/UbtNGvUQGHwfR0X7UGncPJ/YbcRqYyAz CHoilSpQDGVShJMKZqL8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130314_180140_429175_4E5AF63B X-CRM114-Status: GOOD ( 10.53 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.8 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org gcc-4.7 and higher add a lot of false positive warnings about potential uses of uninitialized warnings, but only when optimizing for size (-Os). This is the default when building allyesconfig, which turns on CONFIG_CC_OPTIMIZE_FOR_SIZE. In order to avoid getting a lot of patches that initialize such variables and accidentally hide real errors along the way, let's just turn off this warning on the respective gcc versions when building with size optimizations. The -Wmaybe-uninitialized option was introduced in the same gcc version (4.7) that is now causing the false positives, so there is no effect on older compilers. A side effect is that when building with CONFIG_CC_OPTIMIZE_FOR_SIZE, we might now see /fewer/ warnings about possibly uninitialized warnings than with -O2, but that is still much better than seeing warnings known to be bogus. Signed-off-by: Arnd Bergmann Cc: stable@vger.kernel.org --- I'd like to merge this for 3.9 and also for the stable kernels, if people agree this is a good idea. diff --git a/Makefile b/Makefile index 10fb6c7..caea2d1 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-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 endif