Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp900131pxb; Mon, 16 Aug 2021 21:58:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYSN4f3x7NNDO9Lzt0mqS/EU5vBC+/YO+eqXs1n2Yh00CkgJ3zS9ydMCISxXe41fXBBREk X-Received: by 2002:a05:6602:2595:: with SMTP id p21mr1478278ioo.51.1629176300494; Mon, 16 Aug 2021 21:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629176300; cv=none; d=google.com; s=arc-20160816; b=E8jS7AhnUH7CFPmYhPjdRLco17+iU/2X3GFRXSNGXall1MKWB1NGb3cPbNm5ViyYD3 qh/Zcy04i8V2RFv6H6pojLLGOhaJto99prph/iGKT6naLguqj8zN4lWh7mCUMlvlslB3 zGq8J83ca84EwVdM1xPogsxE5SrbwC0dEohweHI6AOJmA7LYQt+jFGj/dRuOZP/nCc0T NoDQl88ccdPj9RXH0UqijVVufuJuzfX/3q2DYmxlNrEz9zKCiPC1kTkDMkVhmPj2BgAP 1Sw8WwVPdhsMTXXr++hcF/zsBXE5GRksv3eu83A0nDM1R17sI30H5kUezVemdxvN3Ki4 qh1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=aAsaVGPqtLFq+K9meVm6AUEu1FnXH7vAIsduR6tmCdI=; b=oC0Eg4xw//EkwiXMTWxxi9ojCb0md/gsQcnJhidcr4O+43s1s2p6sI9k5E9m4NhpZj gbzTsNKzwOqzo+T0q0PP21ERLIqwqonCTc5MUWImYPhz6L6uaZvy1rTjSEg+VKdVz+s3 gLgxwe/Kueb8/QluGNOBQrP+Qoe1ZwQspvQPmjEHQ/6KKgQ+rp1f4YGAWJQzfBwawbLf 61gF5mkRgz2LeAtz9BX8F2fNi2LgNhC7lgBTFG62KqBfyrKI4V2/x2Gw6Zuj0Iy9xsJ9 Ljtq2YLDS4JuAIQ9p32lbawQ2KKC2Z4m6rqW/9tWQ+DylcwGJNh4JJDDcpSxUp/DLRfm xqVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KcIO1Mdm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si1398805ion.51.2021.08.16.21.58.08; Mon, 16 Aug 2021 21:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KcIO1Mdm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237592AbhHQE4D (ORCPT + 99 others); Tue, 17 Aug 2021 00:56:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:41118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbhHQE4C (ORCPT ); Tue, 17 Aug 2021 00:56:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AD7D60F5C; Tue, 17 Aug 2021 04:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629176130; bh=zlCG6TyqdnDAfWusRcSyF23uFUU7SsCl5cvLhJSJpKc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KcIO1Mdm6d59M7z/WSPAI7ewM15r5aeGwejgZggC7qIMDQAy9J9H4napExPxX0hiI MExJijv0G35sMLI59JiMSLlVIc58x3+RT8mSAWM06kXjtdbH7LxktdLxz3YtEOe/as l9ShwyMFc6qIBK1y/AtnX9zgNG6EosXk8YJeHZP5DG0K92/eSYpqO/dy5EG+GMDnI5 tcvqL25yu535vVWGenjtDSGoPLpqb6AlNTHHtbDyqJ7t0jVWgnmWA228xMBBuV9So2 HycG7kbdWapNKuF2KSrxLJK/LCq6LUMYOL8SjBujK/HcXYsmiNLrRS9PXrIqj3tSVs QIH8U7FCF1fbw== Subject: Re: [PATCH] kbuild: Enable -Wimplicit-fallthrough for clang 14.0.0+ To: Linus Torvalds Cc: "Gustavo A. R. Silva" , Kees Cook , Nick Desaulniers , Masahiro Yamada , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux References: <20210817005624.1455428-1-nathan@kernel.org> <80fa539a-b767-76ed-dafa-4d8d1a6b063e@kernel.org> From: Nathan Chancellor Message-ID: <5c856f36-69a7-e274-f72a-c3aef195adeb@kernel.org> Date: Mon, 16 Aug 2021 21:55:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/2021 9:37 PM, Linus Torvalds wrote: > On Mon, Aug 16, 2021 at 6:20 PM Nathan Chancellor wrote: >> >> Additionally, there should be some time for the CI systems to update >> their clang-14 builds, as the recent 0day report shows. > > What? > > No, the 0day report shows that the patch is buggy, and that the > > ifeq ($(shell test $(CONFIG_CLANG_VERSION) -ge 140000; echo $$?),0) > > clearly doesn't work at all, since the flag is enabled on those > systems with old clang versions. > > Alternatively, the test works, but the 140000 version is not enough. So technically speaking, the 140000 is not enough at this very moment for the fact that there are certain systems that test with clang-14 builds that do not have my clang patch in it yet; however, those systems do update clang regularly (the 0day version is just seven hours old at the time of writing this) so they will have a version that contains my patch shortly, making the check work just fine. We have done this in the past with checks that are gated on clang versions that are in development, with the expectation that if someone is using a development release of clang, they are keeping it up to date so that they get fixes that we push there; otherwise, it is just better to stick with the release branches. > So no. This patch is simply completely wrong, and doesn't fix the > problem with Clang's buggy -Wimplicit-fallthrough flag. If you/Gustavo would prefer, I can upgrade that check to ifneq ($(call cc-option, -Wunreachable-code-fallthrough),) I was just trying to save a call to the compiler, as that is more expensive than a shell test call. Cheers, Nathan