Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2053955ybl; Thu, 29 Aug 2019 02:56:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfyKhwxk8w9KhangOC29CsQi/8OussDRHaSw9+jbOGhzygkL6MvTkZ0n0cDCG4qzRl35o4 X-Received: by 2002:a63:9e56:: with SMTP id r22mr7494383pgo.221.1567072560459; Thu, 29 Aug 2019 02:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567072560; cv=none; d=google.com; s=arc-20160816; b=MBPruahQtUGAST5EevaAIZQnjCTM2hyOLOI92ydzl8USpVEHAUw/qgX/3brXY5wmJu Awhwkvcxa1YtcLdTN8AuUsgro7L0+uSKwdKc9JWd+aPlt2Gon7ntlZ7l8/faSkTykbsY lEegtkLz0TY52eeuFUHDAjrx+7yVuu0LyzXezq+Q8I1C8ByQML00Lvem0R/A5KXKbHP1 1Skd/EmYYHPBfH4Itmdk8x4gfBLlZCFr8VZsAAwXbIS3gC5pvFD/o5HZde3wqLk1dcWm mxZnMNYjSm+3K08aYQNrpPPZPokV8PKJxdUP5a8zqvAsFSGzDztyPEgObLxd0X3zw3+S goug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=8Hq67Aeafty4Z84Qns88hGedO6pSKZUiFFj2yN+1MEo=; b=zJWzk2CrG/zbLo0vTxHg4+4NxZGwFrEtPlWfavc3rNdBin17oa2ox69D29JKWQLNqu bK1JAoXOee7GWKOHEDK3nW9p8f7tbasAT+Sx6u3vmKUlooArn+nj//nvUSNinFn8UduQ GuE8eZreqCe/qamxE9y1vu00Hz10Dno4mjsQO5z809xIbVB4bJ23PZxXClTJ0UtTnQyc lMtTRhM8OE/vb2uYPcb3CDM1wpl/Mfu4CI1zByVf2/qT53zLFpaqatrQxDOZDqOEJAGO 9khmA5eDQwbn5plHRWnVORSpK3QMrex4Jm7ABRIVcCPARR+k0g0pfmuv1P9xmtlucUuK MQ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ARIXIGoF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si2105674pfp.285.2019.08.29.02.55.44; Thu, 29 Aug 2019 02:56:00 -0700 (PDT) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ARIXIGoF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbfH2Jyx (ORCPT + 99 others); Thu, 29 Aug 2019 05:54:53 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35986 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfH2Jyx (ORCPT ); Thu, 29 Aug 2019 05:54:53 -0400 Received: by mail-wm1-f65.google.com with SMTP id p13so3163527wmh.1; Thu, 29 Aug 2019 02:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=8Hq67Aeafty4Z84Qns88hGedO6pSKZUiFFj2yN+1MEo=; b=ARIXIGoFOkwhP7Jlg+hwifP5HMuVmnHMYgUXvAne9Ov8MEZ+wXTb6YRho7eUWE8Pto q01p70Yyo7OSKnPwQ2yKam0Db2pCTNEjEHmeab33HUhQau+P9WA3BeS9m5EhMJiquiwN eFB/izu27UNvTGV+TlHU4es0sY9GW8J5Jd3xOUyFiGNUyQMNxGZSfdpoUF5THt4iFnbT 1nWsP/U+XCdjSNJo/bVv9k93QixeWjCpKkgfI/jVXtPRPdyp7l81ybHJ8IX620ga/tll orhVwQ3eDBuk3bA+gtsHeuvQAnJLQz7Bujsad3JB881t3eDgyZ03nj0coWU9CTHgIkS2 AcHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=8Hq67Aeafty4Z84Qns88hGedO6pSKZUiFFj2yN+1MEo=; b=EDzA1ImTdDHvHdfm08VR66/NnvDhWbiSNeLgqls9FVs6Oh5rH69YlT3/1ens69WjXd iYu5PP5PJptYy8nmoOjlWKW0MzUpj3VBlrrKSKqzsUgGagVOhduUQSflmzcjwAdLQv9o DShwKJeE0AQm4OFJE5pwyT0PqzjyP83QXqmVNySXsqDwYIrH1nDNFaQeO//594DlxYOg DizwXPkch7LtxF+3sH0GIX7EUFI1APpKGKQGqm1JNXMBNjtzj0Eo/Xj9IPMSgGijZ1bx qvnNyIDORLZBv31MtTCRWlCa5JFFEpxfZZdGFYX+f/g6/dJlH4+3N+U+MILzwMATjDAM /+Dw== X-Gm-Message-State: APjAAAXw0TQfwJENqIfdTUizIUQsyrWycO475zNzjUP/8V0g3v+eX9Ui DVgeLErpX8ICWbTPlwnh8v2TC63iUczBupRXIPY= X-Received: by 2002:a05:600c:225a:: with SMTP id a26mr10955239wmm.81.1567072491748; Thu, 29 Aug 2019 02:54:51 -0700 (PDT) MIME-Version: 1.0 References: <20190828055425.24765-1-yamada.masahiro@socionext.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 29 Aug 2019 11:54:40 +0200 Message-ID: Subject: Re: [PATCH 1/2] kbuild: refactor scripts/Makefile.extrawarn To: Nick Desaulniers Cc: Masahiro Yamada , Linux Kbuild mailing list , Nathan Chancellor , Miguel Ojeda , Arnd Bergmann , Michal Marek , clang-built-linux , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > So, if it is desired to pass the CLANG extrawarn compiler-options to > all W=... then I ask myself why the CLANG block is in the W=1 block > only? > So if CLANG extrawarn options are independent of any W=... make-option > then I prefer to put it in a seperate block with an appropriate > comment. > Maybe something like that (on top of the two patches I had sent). From: Sedat Dilek Date: Thu, 29 Aug 2019 11:35:21 +0200 Subject: [PATCH 3/3] kbuild: Move extra warnings for Clang --- Documentation/kbuild/kbuild.rst | 5 +++-- scripts/Makefile.extrawarn | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst index 3e65d32af875..fa9772ae2367 100644 --- a/Documentation/kbuild/kbuild.rst +++ b/Documentation/kbuild/kbuild.rst @@ -245,10 +245,11 @@ KBUILD_EXTRA_CC_CHECKS ------------------------------ If enabled over the make command line with "W=...", it turns on additional compiler warning options like -Wmissing-declarations for more extensive -build-time checking. For more details see . +build-time checking. +Some extra warning options are set for all W=... settings when using Clang. +For more details see . W=1 - warnings that may be relevant and does not occur too often -W=1 - also stops suppressing some warnings W=2 - warnings that occur quite often but may still be relevant W=3 - the more obscure warnings, can most likely be ignored diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 72677ee9f202..86c0f8ae7e35 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -5,6 +5,16 @@ KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) +# +# W=... - stops suppressing some warnings when using Clang +# +ifdef CONFIG_CC_IS_CLANG +KBUILD_CFLAGS += -Wno-initializer-overrides +KBUILD_CFLAGS += -Wno-format +KBUILD_CFLAGS += -Wno-sign-compare +KBUILD_CFLAGS += -Wno-format-zero-length +endif + ifeq ("$(origin W)", "command line") export KBUILD_EXTRA_CC_CHECKS := $(W) endif @@ -30,17 +40,6 @@ KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1 -else - -# W=1 - also stops suppressing some warnings - -ifdef CONFIG_CC_IS_CLANG -KBUILD_CFLAGS += -Wno-initializer-overrides -KBUILD_CFLAGS += -Wno-format -KBUILD_CFLAGS += -Wno-sign-compare -KBUILD_CFLAGS += -Wno-format-zero-length -endif - endif # -- 2.20.1 - Sedat -