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: 3785921 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 D6B349F35F for ; Thu, 6 Mar 2014 17:59:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4AA120256 for ; Thu, 6 Mar 2014 17:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B147E201DE for ; Thu, 6 Mar 2014 17:59:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753704AbaCFR7d (ORCPT ); Thu, 6 Mar 2014 12:59:33 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:55904 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753058AbaCFR7c (ORCPT ); Thu, 6 Mar 2014 12:59:32 -0500 Received: by mail-pd0-f174.google.com with SMTP id y13so2839422pdi.19 for ; Thu, 06 Mar 2014 09:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=converseincode.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=lazLbJI5lwNBtQdvKdMsTv6mfl0ImZPjpV63e39LBZ4=; b=tvFGlzwjKjVw8DTEK8HSU7SKlJXFhWkp7Uwt5CYDMlb0R3aEoCQx3D9WnVjfUsIfRB wjHJRztqh6PlLQum5a3QsnCyBz5WJ4vHcXpcqPl+oIAHI2mOB554H3KCogD6M6FY6hDu 2F8jWrH4hmlXzxEm81pyyDIPQM2zOhUH1YCIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=lazLbJI5lwNBtQdvKdMsTv6mfl0ImZPjpV63e39LBZ4=; b=aL/rbbctaO+pFskfbQXRNoZFR9C8KK7Ckgdyyuzqj8nvxCTQvPoPx9ruI9AsR4JkNg puOWHp08x2okPVb0byRYJZII782jCO2plN1LUIZBtcugfzG9AeGA/4iaeCEpMeIryk0f 6fpHB45Mc3v7UEngXSAPNrHP6pRKt++62FoBLCY4giTBb4ZsgLGIMr0Z0rsodpOct48N Ryvr6oHoOZ0Y2/wIUQgCVHeeygw658QYaqIrbEr0ygULw5NduZ3copQWUdRUAMKKvn+J 8moh+chGc0MgyDW+sl1aOaOlTJavZHAyy5G1CSweA1ICemaLuBxy5pf7aOq48uwHb0n2 hAxw== X-Gm-Message-State: ALoCoQkgTGfX2e/O3LxPRrY8wfhlhCxgaSf3cEQ3f+x81SyKEgWgxWyOpTRgvjHW3i8cISQHQytH 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-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=ham 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 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