From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C106FC636C9 for ; Fri, 16 Jul 2021 01:27:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DD07613D9 for ; Fri, 16 Jul 2021 01:27:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231666AbhGPB34 (ORCPT ); Thu, 15 Jul 2021 21:29:56 -0400 Received: from gateway36.websitewelcome.com ([192.185.193.119]:18076 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbhGPB3z (ORCPT ); Thu, 15 Jul 2021 21:29:55 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 0C44C40153B79 for ; Thu, 15 Jul 2021 20:26:58 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 4Cd0mkqcsuMjb4Cd0mXJ28; Thu, 15 Jul 2021 20:26:58 -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=4ffx1bAv414YMi1a8ax0I4veMZTSEXNs7IRiNasuJUI=; b=ixPCJxq321RHehbRKwj1q8fkZ5 9a7GJWJKgizpVgnD1Q3b+ncjd9I25RWnvhwzOv7m678V4BFtpDlYDT9IiaF3JQtHAjD+GIf5zuwCF b9YJlSychUOKeon8UJ62vNgIZBSgLQJNL4Njcji3lf13ov5C2ytc9u8zlBtP/w3RQIIEvJXxM5n5l rinWp9aEaaKxqrAxO9b4UVb2RwJkyyrMXvz+WOaBIxc86SJcHG1vXq/2XXy8/JEViWJz1ovgoQCs7 xdbkIc7K+QmUZabqAw3pvNHmlOzgzlAgTojXBhfbUFJyCGsyQGbZerqkCfQy8fSZrocJ0D7syEjcm MGzDgalw==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:40530 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 1m4Ccx-003ZSU-Ko; Thu, 15 Jul 2021 20:26:55 -0500 Subject: Re: [GIT PULL] fallthrough fixes for Clang for 5.14-rc2 To: Linus Torvalds Cc: "Gustavo A. R. Silva" , Nathan Chancellor , Nick Desaulniers , Kees Cook , Linux Kernel Mailing List , clang-built-linux References: <20210714200523.GA10606@embeddedor> <5d170cc8-501d-0cec-bf03-2f53108a8486@embeddedor.com> From: "Gustavo A. R. Silva" Message-ID: <31b951ff-9c65-b774-87a9-35c28e54636a@embeddedor.com> Date: Thu, 15 Jul 2021 20:29:07 -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: 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: 1m4Ccx-003ZSU-Ko 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]:40530 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 13 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/15/21 20:22, Linus Torvalds wrote: > On Thu, Jul 15, 2021 at 6:14 PM Gustavo A. R. Silva > wrote: >> >> Kees just opened a bug report for this: >> >> https://bugs.llvm.org/show_bug.cgi?id=51094 > > I don't have an account on that bugzilla, but it might be worth adding > the note that no warning or error should EVER not say where it > happens. Yeah; I'll add that to the report. Here is the current description of the bug: "There are some places in the kernel where the "fallthrough;" annotation is used after a portion of code that may get elided at build time: case 1: if (something || !IS_ENALBED(CONFIG_SOMETHING)) return blah; fallthrough; case 2: This looks like: case 1: fallthrough; case 2: And a warning is generated: warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough] But isn't a useful warning in this case, and should likely be silenced or adjust to not warn where there was actually code there before getting elided. At the least, this warning would be best moved to a separate flag so it can be disabled on kernel builds (i.e. GCC does not warn about these cases). Some specific examples: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3058126539?check_suite_focus=true#step:5:120 https://github.com/ClangBuiltLinux/continuous-integration2/runs/3058126329?check_suite_focus=true#step:5:92 " > That's the thing that made me pissed off in the first place. I build > my kernels with "make -j128", and if the warning doesn't specify the > filename and the line number, the warning is just unacceptably bad. > > How can a compiler _ever_ give a warning without specifying where it is? > > The fact that the warning is also entirely wrong-headed in the first > place is just the extra cherry on top. > > But at least it should hopefully make it easy to fix in clang - just > remove the incredibly broken thing entirely. > > Linus > -- Gustavo