Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1623754pxb; Tue, 17 Aug 2021 16:58:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBnLisnKFcdBFNNKGQhlZ08v/J8G/EkBjDAS+D2pjsNg3rar+lJLDZanTepuYs5QwR2N13 X-Received: by 2002:a92:6a03:: with SMTP id f3mr3833394ilc.43.1629244739668; Tue, 17 Aug 2021 16:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629244739; cv=none; d=google.com; s=arc-20160816; b=cyQQ/dfv/upwHNqMgQ1RhymSWuTQ38HpdyxWG8dbrde2CUZjJyGxmAI/0hysOrrygZ Ue48dnirIJKH+axbXce9BQIrG9D4W0cdQn7EvxG+4fcMe0uoE5OygzNrEVQsiFyO/dmz Fbbm4eBy0nf0dtNUicm3M9QAOw/MKXDkPzfn6wvITIWZhLQVDtBCByro/NSlKmgnpO4S cPE34gognDVA16OqI1Nga3VEdwcXwI/avJ/wGvY4O3u8GnDOMxiMYUeAS1tdBJh36J+k jEW3T2lRbWN5a9jID0lx+0D/UPcpJyYttwjSvJQSdwZmQ4GhhuqsjVA3L9cP6xvO5ytZ E46w== 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=AzVDzK8a1EEVePdeojHw8a1gJ0hcdK6QJHkvzwsDxKQ=; b=osLytfqIMwXTe/1reF5HqyN5U+WPrXbOUArn7z8P7LZvb4hjjnaFyOAAJ5jLoXTjLl j+607l8ISzYmxQUQH/9jQDhjCphpdvmFpVpW6gWFTeHq0lA4x31REZxmC2aRL8kjefvN 7Ar4Tg0uagfgc0zHVEYrm0tpZ8HExI2vfLUKkrjcjya1YnbLMUdF0b4eCYWcfyyi6v4a u2CwWg6Ht7RTNgBq0HrifuQND9aAevEFgHvFi3vJypp+G1Nz2nkQ/N+Ti5b5EePU+tda //R5lwUIX7E4ZfCwCBUJtpo2eoaBHZFhYn/79vHJU4VhtJmm+F87K4ypo2C6iJoT9TTy y60A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=cFdaytld; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si3994430ill.67.2021.08.17.16.58.47; Tue, 17 Aug 2021 16:58:59 -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=fail header.i=@embeddedor.com header.s=default header.b=cFdaytld; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236693AbhHQX6S (ORCPT + 99 others); Tue, 17 Aug 2021 19:58:18 -0400 Received: from gateway20.websitewelcome.com ([192.185.49.40]:47116 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235450AbhHQX6S (ORCPT ); Tue, 17 Aug 2021 19:58:18 -0400 X-Greylist: delayed 1221 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Aug 2021 19:58:17 EDT Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 5336E400D2804 for ; Tue, 17 Aug 2021 18:20:16 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id G8e2mfNqmBvjyG8e2mEk2p; Tue, 17 Aug 2021 18:37:22 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AzVDzK8a1EEVePdeojHw8a1gJ0hcdK6QJHkvzwsDxKQ=; b=cFdaytldjPLnPidWap/zvaUh+s DQNHq3Mbh59DJZ32pXWxDEQtjJ7Av/iwnObHqrh+HvSXI+MeUryFg5UkkmXc9FDllFn5dXs0npLlG GY2vE/itqS/iFQQeCSnLc7wtbNoybTIP1mYCVCJOpHhItLyx2NPhXjTvURMvxY8a6/lA00odCJNx3 xHj39mxLjVvj0+2Wwr2pAIIXpbpKiOcQcpC/9OumnuSaZGfQAzb8ZTmolHLWIWCKOUCGneXOx91BV YDTsr+J38QeY0KUkvTBMJuMg1ptKc3DVWNQy5HopKjt+TaHbNZXmD9Ii3gqKv5eRCY6at1rSiZArv 0aLDxiQQ==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:44668 helo=[192.168.15.8]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mG8e2-001l7W-2S; Tue, 17 Aug 2021 18:37:22 -0500 Subject: Re: [PATCH] kbuild: Enable -Wimplicit-fallthrough for clang 14.0.0+ To: Nathan Chancellor , Kees Cook , Philip Li Cc: Masahiro Yamada , Linus Torvalds , "Gustavo A. R. Silva" , Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , linux-hardening@vger.kernel.org References: <20210817005624.1455428-1-nathan@kernel.org> <80fa539a-b767-76ed-dafa-4d8d1a6b063e@kernel.org> <5c856f36-69a7-e274-f72a-c3aef195adeb@kernel.org> <202108171056.EDCE562@keescook> <3f28b45e-e725-8b75-042a-d34d90c56361@kernel.org> <71d76c41-7f9b-6d60-ba4f-0cd84596b457@embeddedor.com> <202108171602.159EB2C7EA@keescook> <72ae69b4-6069-ade5-a12b-8ee0435f803a@kernel.org> From: "Gustavo A. R. Silva" Message-ID: <1f05cd38-c576-0ded-81b6-fe0b49a5059e@embeddedor.com> Date: Tue, 17 Aug 2021 18:40:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <72ae69b4-6069-ade5-a12b-8ee0435f803a@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.31.110 X-Source-L: No X-Exim-ID: 1mG8e2-001l7W-2S X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-31-110.static.axtel.net ([192.168.15.8]) [187.162.31.110]:44668 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 9 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/17/21 18:23, Nathan Chancellor wrote: >>>> # Warn about unmarked fall-throughs in switch statement. >>>> # Clang prior to 14.0.0 warned on unreachable fallthroughs with >>>> # -Wimplicit-fallthrough, which is unacceptable due to IS_ENABLED(). >>>> # https://bugs.llvm.org/show_bug.cgi?id=51094 >>>> ifeq ($(firstword $(sort $(CONFIG_CLANG_VERSION) 140000)),140000) >>>> KBUILD_CFLAGS += -Wimplicit-fallthrough >>>> endif > > Very clever and nifty trick! I have verified that it works for clang 13 and 14 along with a theoretical clang 15. Gustavo, feel free to stick a > > Reviewed-by: Nathan Chancellor > Tested-by: Nathan Chancellor > > if you so desire. Yep; I just tested it locally with clang 13 and 14, too. Thanks -- Gustavo