From patchwork Fri Aug 1 04:08:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 34686 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BBF720792 for ; Fri, 1 Aug 2014 04:08:37 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf24263324pab.8 for ; Thu, 31 Jul 2014 21:08:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=9DbgbOVRA1cjWKgjaY3fIch7S4ks7oySh5P4Xk3w5rA=; b=EvjpnUQVIvf/f3NV83q54R9vWq4M/t/F2cTstGCg5lzoj7BfYWBgHI8ANpShG46XKX kdc9eTD+x0PdkEQWcieEHG0Imh4N5uvm6jGrZF++fsOIRYGj5+S7qTI+mtz47uangiYO lmZuJp8NxU5AkO78+Xl8uEYN/IR4dfX+RWwamiyg0d9/b8nOxAz36mHtLDnswnbFazqN ViB4BPf3pkFtVJBMKNiQhrR/UbJvgiQWGzyjNn61RcQdW90MNCgZYKXTgBEaOtuvrc2t HeePYLpaknwXfBWGFuB4TZ8wM9HWUvJ0LZdLrtABMQAxsyNDZj9do4hVKshkQzYkHbjr Dr3g== X-Gm-Message-State: ALoCoQn5bDb/CExGjsOotwt0Sua5jd3+93ahFBsnrHnvsdEXV/m7qmB9zFGtHhGN4yT1Vsilu0E4 X-Received: by 10.66.216.161 with SMTP id or1mr1265256pac.38.1406866116674; Thu, 31 Jul 2014 21:08:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.199 with SMTP id k65ls384876qge.3.gmail; Thu, 31 Jul 2014 21:08:36 -0700 (PDT) X-Received: by 10.52.243.10 with SMTP id wu10mr2694201vdc.45.1406866116569; Thu, 31 Jul 2014 21:08:36 -0700 (PDT) Received: from mail-vc0-x231.google.com (mail-vc0-x231.google.com [2607:f8b0:400c:c03::231]) by mx.google.com with ESMTPS id wa10si6369529veb.79.2014.07.31.21.08.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 31 Jul 2014 21:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::231 as permitted sender) client-ip=2607:f8b0:400c:c03::231; Received: by mail-vc0-f177.google.com with SMTP id hy4so5646495vcb.36 for ; Thu, 31 Jul 2014 21:08:36 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr3297622vcb.0.1406866116426; Thu, 31 Jul 2014 21:08:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp76356vcb; Thu, 31 Jul 2014 21:08:35 -0700 (PDT) X-Received: by 10.66.240.197 with SMTP id wc5mr2809264pac.87.1406866114620; Thu, 31 Jul 2014 21:08:34 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca5si4107992pdb.158.2014.07.31.21.08.33 for ; Thu, 31 Jul 2014 21:08:34 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753060AbaHAEIc (ORCPT + 19 others); Fri, 1 Aug 2014 00:08:32 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:47621 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbaHAEIa (ORCPT ); Fri, 1 Aug 2014 00:08:30 -0400 Received: by mail-pd0-f173.google.com with SMTP id w10so4725280pde.32 for ; Thu, 31 Jul 2014 21:08:30 -0700 (PDT) X-Received: by 10.68.213.34 with SMTP id np2mr11919pbc.167.1406866110123; Thu, 31 Jul 2014 21:08:30 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id n8sm10890698pdm.22.2014.07.31.21.08.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Jul 2014 21:08:29 -0700 (PDT) From: behanw@converseincode.com To: mmarek@suse.cz Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org, Behan Webster , =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= , Mark Charlebois , bp@alien8.de Subject: [PATCH v3] kbuild, LLVMLinux: Supress warnings unless W=1-3 Date: Thu, 31 Jul 2014 21:08:25 -0700 Message-Id: <1406866105-24980-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <53DAAB35.8080206@suse.cz> References: <53DAAB35.8080206@suse.cz> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Behan Webster clang has more warnings enabled by default. Turn them off unless W is set. This patch fixes a logic bug where warnings in clang were disabled when W was set. Signed-off-by: Behan Webster Signed-off-by: Jan-Simon Möller Signed-off-by: Mark Charlebois Cc: mmarek@suse.cz Cc: bp@alien8.de --- Makefile | 1 + scripts/Makefile.extrawarn | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index f6a7794..f343e17 100644 --- a/Makefile +++ b/Makefile @@ -668,6 +668,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) # source of a reference will be _MergedGlobals and not on of the whitelisted names. # See modpost pattern 2 KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) +KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) else # This warning generated too much noise in a regular build. diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 6564350..4315d34 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -26,16 +26,6 @@ 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) -# Clang -warning-1 += $(call cc-disable-warning, initializer-overrides) -warning-1 += $(call cc-disable-warning, unused-value) -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-option, -fcatch-undefined-behavior) - warning-2 := -Waggregate-return warning-2 += -Wcast-align warning-2 += -Wdisabled-optimization @@ -64,4 +54,16 @@ ifeq ("$(strip $(warning))","") endif KBUILD_CFLAGS += $(warning) +else + +ifeq ($(COMPILER),clang) +KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) +KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) +KBUILD_CFLAGS += $(call cc-disable-warning, format) +KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option) +KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare) +KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length) +KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized) endif +endif +