Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1842651ybl; Sun, 18 Aug 2019 11:44:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLjgBJguDXLF8ZqH6oGnflCfKOgpYPVY4efFFqGJR2QcgOovvw/mUcBf6hohQzJwbolHR1 X-Received: by 2002:a65:4c4d:: with SMTP id l13mr16417231pgr.156.1566153893762; Sun, 18 Aug 2019 11:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566153893; cv=none; d=google.com; s=arc-20160816; b=sUrOzaiIFDn+NP96oul8931r1IlI6r+2wDGm4vzJlLJR3/GP3W+UyMSeQeE9pbWAgn mQLAsVzdvR+f07Axbrr1VF57QHPulQsoSlj0bxV7SarAEku7B1LkBZ9FjjlRE34cxnTu TWOUF8zxTBDgtf6K6zqdNhou5xawtscPxHKQWo0jlNjCjfzu7oH/+lbD3tdxbV9Yhcnw 7KPUEGsLVAsDfyctw4BgQsRZMo9X0Pbp/1C9mnb5WWvHucjhKmIDeWbkHTxy+UGp3O8n +DvzdurjUImJNYxL6WZUnrPIhAksNnZWFirg+3o+XOVVjVI3YY/uLNWTlUNiPjtpR9ik AEqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0CK+Y2zsIdvfbs/HayvWMRpWvdlab8WBL02QhMYqRsk=; b=XUGt+VViNcML39svorNyAewMxoEHJiX7KQHzWoNK/G9pj0VT2RbkTtXti+yaGBIQfO 6jyUY+rPjaDzkd9bdbfv8zAAvfInKecPls/67aVmIZpVcZgaGekxHvYmGXPoXLAadWne EK+m0LyawfpkWsdsxQfQFZwbOl2ORvfkhi0Xk+G0aNafXJNKHWg4gswU4lBT1io5bNJK +CykGJIO6jQb31eHH3O3jegXGJdVx6MfUTef40eV9B8YZl2JE3d6pIwrSIzxhWDbbLVE FwGIKG3ygLmSFGtGxt4ZddUCDywD+/T190AAlV25hOvQCUZcqzmkt5tq03DJ08jb2hsA lU3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hNczk6eU; 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 f1si8381132plf.410.2019.08.18.11.44.39; Sun, 18 Aug 2019 11:44:53 -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=hNczk6eU; 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 S1727067AbfHRSnq (ORCPT + 99 others); Sun, 18 Aug 2019 14:43:46 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51592 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbfHRSnp (ORCPT ); Sun, 18 Aug 2019 14:43:45 -0400 Received: by mail-wm1-f66.google.com with SMTP id 207so1128065wma.1; Sun, 18 Aug 2019 11:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0CK+Y2zsIdvfbs/HayvWMRpWvdlab8WBL02QhMYqRsk=; b=hNczk6eUNc4L2ZsBOZKUP0jkZdVmpS6I1ISvnCu3idVaUguq+jPyAixZA/wFUmzHyh wRQhGFg3q74xWw7iNqGcr3g9dQcWxiZLrpvp9EtKnh4C+Iw2cmy24YEJcxYjk4DNbRdr 1i1BLRIvhQsAd7wQlfzszwP1wQfb25yeGJPZr5tffL3OHYD6lvG2Zu7LvSKwlzeN0kXJ 4Xu/4ezZQTVgRjpHGBtnNWmsdNJ4P6HLJqXh/fxIZXaYgrH0TzO3xFjArpoQF3zSWOqq tjDA9525Bs+OpvrSzKUGAPn/LzO9Q1EuNZgO4xMkVmfoYuHoe46n4KQfwu/IxVvayolA xi+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0CK+Y2zsIdvfbs/HayvWMRpWvdlab8WBL02QhMYqRsk=; b=X9+dCJC4zd/OqJuo3hiF4xkjEh3PxjP5jDKsF5MC3j/q/ZVJ9gSYay0e+zdrL+qxmT GhR1RKL5mGwErcq32OzU6YQpedDBA/Fkij6CRr6sLS0VuHOfY5qwfLzZ9UdXMiJfyA0T +jXbiLRGGbCWAYikRH+Vtlbdmgf4fliKqW/eYQ8gv/le53UdT3fItUtMjXsoARN13wVU Rn52E0TR/FZOzDDp5rV5h6nQoXOOZaPoERmt+Nt+dvinuoVkM5NHUusIRdXaY2T/zi92 CzdMelCp3S9bwfTUdRsQiC+fCZAYAYH6W3uPEJ3InkUoR9OrVdk64nInc5mCOYLxtYnn QBbw== X-Gm-Message-State: APjAAAXPEaiigPrQabPxQojfvHNfuU+QxQPYblH4aY4pOQHQRbNzaSe0 5ip40T1rqTxGcbEkvKB9ZGY= X-Received: by 2002:a1c:1f4e:: with SMTP id f75mr16298964wmf.137.1566153823955; Sun, 18 Aug 2019 11:43:43 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id n9sm2476870wrx.76.2019.08.18.11.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 11:43:43 -0700 (PDT) Date: Sun, 18 Aug 2019 11:43:41 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: Nathan Huckleberry , Michal Marek , Joe Perches , Miguel Ojeda , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux Subject: Re: [PATCH v2] kbuild: Require W=1 for -Wimplicit-fallthrough with clang Message-ID: <20190818184341.GA6262@archlinux-threadripper> References: <20190815225844.145726-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2019 at 01:43:08AM +0900, Masahiro Yamada wrote: > Hi. > > On Fri, Aug 16, 2019 at 7:59 AM Nathan Huckleberry wrote: > > > > Clang is updating to support -Wimplicit-fallthrough on C > > https://reviews.llvm.org/D64838. Since clang does not > > support the comment version of fallthrough annotations > > this update causes an additional 50k warnings. Most > > of these warnings (>49k) are duplicates from header files. > > > > This patch is intended to be reverted after the warnings > > have been cleaned up. > > > > Signed-off-by: Nathan Huckleberry > > Suggested-by: Nathan Chancellor > > Reviewed-by: Nathan Chancellor > > --- > > Changes v1->v2 > > * Move code to preexisting ifdef > > scripts/Makefile.extrawarn | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn > > index a74ce2e3c33e..95973a1ee999 100644 > > --- a/scripts/Makefile.extrawarn > > +++ b/scripts/Makefile.extrawarn > > @@ -70,5 +70,6 @@ KBUILD_CFLAGS += -Wno-initializer-overrides > > KBUILD_CFLAGS += -Wno-format > > KBUILD_CFLAGS += -Wno-sign-compare > > KBUILD_CFLAGS += -Wno-format-zero-length > > +KBUILD_CFLAGS += $(call cc-option,-Wno-implicit-fallthrough) > > endif > > endif > > -- > > 2.23.0.rc1.153.gdeed80330f-goog > > > > > Perhaps, is the following even cleaner? > > > > diff --git a/Makefile b/Makefile > index 1b23f95db176..cebc6bf5372e 100644 > --- a/Makefile > +++ b/Makefile > @@ -751,6 +751,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 += -Wno-unused-but-set-variable > + > +# Warn about unmarked fall-throughs in switch statement. > +KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,) > endif > > KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) > @@ -845,9 +848,6 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) > -print-file-name=include) > # warn about C99 declaration after statement > KBUILD_CFLAGS += -Wdeclaration-after-statement > > -# Warn about unmarked fall-throughs in switch statement. > -KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,) > - > # Variable Length Arrays (VLAs) should not be used anywhere in the kernel > KBUILD_CFLAGS += -Wvla > > > > -- > Best Regards > Masahiro Yamada I like this more than anything suggested so far. I think a comment should be added regarding why this is only enabled for GCC right now but that is pretty easy to revert once we have figured out the right course of action. Cheers, Nathan