Received: by 10.223.176.5 with SMTP id f5csp907365wra; Fri, 2 Feb 2018 08:03:14 -0800 (PST) X-Google-Smtp-Source: AH8x225lidDgB1f8qRtNxPH8xbzpbszRt36FUOgyP7fxx40bWBxBioUWRk5Ut6/D2vAurxdgblES X-Received: by 10.98.9.67 with SMTP id e64mr39995226pfd.230.1517587394872; Fri, 02 Feb 2018 08:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517587394; cv=none; d=google.com; s=arc-20160816; b=nwLJijHljRYWPkzDP05kfgPidUxUpg5l10Rt5Ay6etv4DSycOFyttiKzrkgBXFSVqm 9IItDHpLaoVG+eCFW+bhUsMiXs2TwpHJJQbQQW41zJq5oGb4YCz16oLjR8SBGL+qYixt O/RTDRL8j9OkIro8Ul7+QPk5IWSP3RwkC99uf95eB43ENoXdvsYUQwSjiT26+ixIqj/i G6zSxDYxu6lRQK3899DcKD/+XYy6y01/m9aTv7adInXFVrsuR9v3Sb2i5mehX9CCvVZX rAF5V91ovVNgIlzor00v9a94ypehHWpzC8fiEYeo6o7GhgHrio/h9R9OSG3x21C00Edw hzkQ== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=OAh46fA3mfN3c5X54vn6Xq4CKX7QdhfBzvJ/5HdT7RU=; b=s+S6dBu80bhifDiGbpGxAk8O3FP4TJcC0J7X0pIBYRZxGvc9EbPPSeBX3V3GDIsEkK LBr797migask5iTgR0aLXhMVfQyFcB+UKowEki2m/g3C0KQqXriHV0lgPQaBgm3MUpRR S3SbiCj1kHDpBBuM+/B6Ahuz4WJ+JQVJGXYCzA8ZDfnZ7kt+3p0ZeX1tZHbudXijrJNP S7DpzaIZzZjkn0N1IMr/mC7fmgiSByNNXbPEBB934P9iYtGl4yzBDSu2O3WZsKFxsPrD 6GPh76OgE2aL4HJBNzimNzIZtauTPQh8ThopiGsIWVE6k7V18kRTDGuYGk55VRsgz6Io q15Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oMNrEypR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si2020404pll.210.2018.02.02.08.02.59; Fri, 02 Feb 2018 08:03:14 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oMNrEypR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbeBBQCB (ORCPT + 99 others); Fri, 2 Feb 2018 11:02:01 -0500 Received: from conssluserg-01.nifty.com ([210.131.2.80]:25282 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833AbeBBQBx (ORCPT ); Fri, 2 Feb 2018 11:01:53 -0500 Received: from mail-vk0-f46.google.com (mail-vk0-f46.google.com [209.85.213.46]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w12G1fHh005479; Sat, 3 Feb 2018 01:01:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w12G1fHh005479 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1517587302; bh=OAh46fA3mfN3c5X54vn6Xq4CKX7QdhfBzvJ/5HdT7RU=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=oMNrEypRAxY9GMf1AB9SucjNTtctXnuV/yIDtbmKZZyVRgYSq6t9JpIQiaS+psWFg OTwnq13mCnMQxm0nBmSRSKiYnQW8zz51r8aYaCD+yVWBpbeUn356dz7N0zfC0jRtf6 8N7QGO9AMXRLkBvYq4smSHeLMMSWEV7jPR+jr0uM+5z8sKpNN2Nmw5O/+pGd6iPJPT 5Z8QPXwxUmS/A24opw+lNsZK2HMroAeOEqhwurfY1lkHFOG+8XGdRa/nkpvnkM67bq IL9yXVYOV/mGcy0TrrqrZpUpntuULn3ZSP/DYRWq74MOQZ3OGcZ3yuyIUVYVBhoa/b toDTdJK/hdLRg== X-Nifty-SrcIP: [209.85.213.46] Received: by mail-vk0-f46.google.com with SMTP id h69so13766000vke.7; Fri, 02 Feb 2018 08:01:42 -0800 (PST) X-Gm-Message-State: AKwxytf6mqP6VqOTILpmANXQvXQ5jg/cVNoGEj+4NePNfJRzgmeT3qQX OwvvhjMzv/ZYN0O3TkrlCiY0RiWXWa0H0jZUI5k= X-Received: by 10.31.235.132 with SMTP id j126mr29809519vkh.193.1517587301193; Fri, 02 Feb 2018 08:01:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.83.212 with HTTP; Fri, 2 Feb 2018 08:01:00 -0800 (PST) In-Reply-To: <1517245680-3361-1-git-send-email-psodagud@codeaurora.org> References: <1517245680-3361-1-git-send-email-psodagud@codeaurora.org> From: Masahiro Yamada Date: Sat, 3 Feb 2018 01:01:00 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: clang: Disable -Wunused-const-variable warnings To: Prasad Sodagudi Cc: Greg Kroah-Hartman , segher@kernel.crashing.org, Greg Hackmann , Linux Kbuild mailing list , Linux Kernel Mailing List 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 2018-01-30 2:08 GMT+09:00 Prasad Sodagudi : > Currently -Wunused-variable warnings are disabled with > clang and with gcc -Wunused-variable warnings are > enabled, with this setting all unused local variables > would be warned in clang as well. > > Disable -Wunused-const-variable warnings instead of > disabling -Wunused-variable warnings, So that in both > clang and GCC -Wunused-const-variable gets disabled. > > Signed-off-by: Prasad Sodagudi The code is OK, but I'd like to make the log even clearer. The commit subject "kbuild: clang: Disable -Wunused-const-variable warnings" sounds confusing. -Wunused-const-variable was already disabled for clang because it was implied by Wno-unused-variable. So, this patch is effectively enabling -Wunused-variable, right? How about something like follows? ------------------------->8--------------------------------------- kbuild: clang: disable unused variable warnings only when constant Currently, GCC disables -Wunused-const-variable, but not -Wunused-variable, so warns unused variables if they are non-constant. While, Clang does not warn unused variables at all regardless of the const qualifier because -Wno-unused-const-variable is implied by the stronger option -Wno-unused-variable. Disable -Wunused-const-variable instead of -Wunused-variable so that GCC and Clang work in the same way. --------------------------->8-------------------------------------- If it is tedious to resend, shall I reword the log locally? Let me your thought. > --- > Makefile | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 339397b..4b6c8e2 100644 > --- a/Makefile > +++ b/Makefile > @@ -698,7 +698,6 @@ KBUILD_CFLAGS += $(stackp-flag) > > ifeq ($(cc-name),clang) > KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) > -KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) > KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) > KBUILD_CFLAGS += $(call cc-disable-warning, gnu) > KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) > @@ -716,9 +715,9 @@ else > # These warnings generated too much noise in a regular build. > # Use make W=1 to enable them (see scripts/Makefile.extrawarn) > KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) > -KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) > endif > > +KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) > ifdef CONFIG_FRAME_POINTER > KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls > else > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project > -- Best Regards Masahiro Yamada