From patchwork Thu Mar 6 17:59:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 25831 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D6AFE203C3 for ; Thu, 6 Mar 2014 17:59:41 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf11018929ieb.5 for ; Thu, 06 Mar 2014 09:59:41 -0800 (PST) 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=tZtN0CQS9+ylqgtLT9r1uyCD+ZCVlfKp2hG8HJ95GH0=; b=lWo9EqjFKFZ4ePS5zV8VocuvOEx71KL2Sw3tOu+ZMvfRBpRYGVhB02H24Pg7m4xfQX VvIQT/dgt7RygERBkz8e6OlfDKipELJ/My+Uob9dzSeCvBK7QY3CB4oTrh0o6hjxsJIU M13KcTAKMp7pZ4r2hWWkQZHZD52lFfJ8QVLlSpP67IuWK305EbnXu63igWerU1afqbYa wNT3l6VBj1esYNXRQGUFAWKh6QNE9JG30AGAZRtBP4n4QGACzRfl8OWL326DsrZHVb7+ V2Un0AD6y9d2mOijCYT7scP/AMkrIZ0t5PPwm+n7tk5FSyKhsgxiLnBBizc6VwjAbhb3 PL9A== X-Gm-Message-State: ALoCoQki49JViI32t6vbWCKz1GWEE7Qm0yvfwLBAlSrb6hzSsnQ5P0ROgLndSJGTusPLCo9Rll93 X-Received: by 10.182.153.68 with SMTP id ve4mr4855588obb.39.1394128781351; Thu, 06 Mar 2014 09:59:41 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.9 with SMTP id k9ls847301qgf.78.gmail; Thu, 06 Mar 2014 09:59:41 -0800 (PST) X-Received: by 10.220.114.135 with SMTP id e7mr6146120vcq.23.1394128781213; Thu, 06 Mar 2014 09:59:41 -0800 (PST) Received: from mail-vc0-x229.google.com (mail-vc0-x229.google.com [2607:f8b0:400c:c03::229]) by mx.google.com with ESMTPS id xt2si1323179vcb.108.2014.03.06.09.59.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 09:59:41 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::229; Received: by mail-vc0-f169.google.com with SMTP id hq11so3073423vcb.28 for ; Thu, 06 Mar 2014 09:59:41 -0800 (PST) X-Received: by 10.52.107.35 with SMTP id gz3mr8791295vdb.8.1394128781125; Thu, 06 Mar 2014 09:59:41 -0800 (PST) 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.220.78.9 with SMTP id i9csp56427vck; Thu, 6 Mar 2014 09:59:40 -0800 (PST) X-Received: by 10.66.191.228 with SMTP id hb4mr15726407pac.151.1394128780051; Thu, 06 Mar 2014 09:59:40 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zj6si5678279pac.1.2014.03.06.09.59.39; Thu, 06 Mar 2014 09:59:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753721AbaCFR7e (ORCPT + 26 others); Thu, 6 Mar 2014 12:59:34 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:44578 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbaCFR7b (ORCPT ); Thu, 6 Mar 2014 12:59:31 -0500 Received: by mail-pa0-f49.google.com with SMTP id lj1so2940793pab.8 for ; Thu, 06 Mar 2014 09:59:31 -0800 (PST) X-Received: by 10.66.250.202 with SMTP id ze10mr16202084pac.153.1394128771271; Thu, 06 Mar 2014 09:59:31 -0800 (PST) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id qh2sm42399972pab.13.2014.03.06.09.59.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 09:59:29 -0800 (PST) From: behanw@converseincode.com To: mmarek@suse.cz Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org, pageexec@freemail.hu, =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= , Behan Webster , Mark Charlebois Subject: [PATCH 2/5 v2] kbuild: LLVMLinux: Adapt warnings for compilation with clang Date: Thu, 6 Mar 2014 09:59:23 -0800 Message-Id: <1394128763-2976-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393376923-21892-3-git-send-email-behanw@converseincode.com> References: <1393376923-21892-3-git-send-email-behanw@converseincode.com> 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=neutral (google.com: 2607:f8b0:400c:c03::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (bad format) header.i=@converseincode.com 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: Jan-Simon Möller When compiling kernel with clang, disable warnings which are too noisy, and add the clang flag catch-undefined-behavior. Re-enable warnings for self-assigns due to David Jones removing most of them already from the kernel code base. Signed-off-by: Jan-Simon Möller Signed-off-by: Behan Webster Signed-off-by: Mark Charlebois Cc: PaX Team --- scripts/Makefile.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index d5d859c..5cd6651 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -65,12 +65,22 @@ warning- := $(empty) warning-1 := -Wextra -Wunused -Wno-unused-parameter warning-1 += -Wmissing-declarations warning-1 += -Wmissing-format-attribute -warning-1 += -Wmissing-prototypes +warning-1 += $(call cc-option, -Wmissing-prototypes) 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) +# 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