Received: by 2002:a05:6520:2586:b029:fa:41f3:c225 with SMTP id u6csp4303627lky; Tue, 15 Jun 2021 19:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgPWIVyTwoFInfOudSMWPVx16WmXmDTECu9TdwWT7gD9ri6XfjkBKr14Hyu0INU/MtBqOI X-Received: by 2002:a92:d843:: with SMTP id h3mr1797962ilq.179.1623809997114; Tue, 15 Jun 2021 19:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623809997; cv=none; d=google.com; s=arc-20160816; b=qiqWCJ3TIcoJDWE5u4oyhbjO5TbXzk7ADSlTLPXWH08pw4ThnOUFgfr1FDaBtRDZSy V7RuwhQv1quH7/y3bSBlgb0CN5BWQXtMgNbUSwkFUWxFHVRHUEslrvX+ATJX9ISGtxD7 n913GkaOIlATh2aJKPSC8+D9KJioX/0Vq+yAvrZaNLkVmqRt4A+FKY7V2zhAZfxnqI8X BqE525CiCVSmC5rrJM4EkXcCRXwasr7fJYIwvI605voBTdtDTuRt0ymThszHkud6wTq+ V5UWowOHjC0nSmjH/ev/0AKiZwhXU9z7nDHli4AzL7xQRb/3wyQjB8Sxnc0+WCzWkyrS YTew== 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:references:cc :to:from:subject:dkim-signature; bh=cAFNJ1/DwVcSuyRvAwvNKZrXlrL9rYgK3W8Ic4ttV/8=; b=pbVW10oKDOnm24SoNu9F5gwx+yM2cnP9Ugle/W0ZWGkSbKWJ4hnrhWrkEH3eVYKvq2 9kS731MdkwyDqz4zIcc/c+XhTG1zgMJoLkPtwUy52hRtgE9f+5NrGSVFPU7OijW8A/Gu Bkx+UqUG+C6YiE0LviCoa0GNbkN85W5nvyU+S9b6f2IAub5b4vm1ueIQ4hDC0P0PIwYh aiPuF6wws3Ce4QhNoJlH4p3z/iTPM7SuOL1Z5DKangR1vyOh51FHFoMDa0A+KXmrNNLa GQEdppEto/UEEl9YbltrBmL8YS+SL+X0yV9+7KvhXFvgDYIFtyFg9AN8gm/DJvXSeKpc G3gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=h4O7+9Vs; 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 q4si760938ilm.12.2021.06.15.19.19.44; Tue, 15 Jun 2021 19:19:57 -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=@infradead.org header.s=bombadil.20210309 header.b=h4O7+9Vs; 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 S231356AbhFPCVM (ORCPT + 99 others); Tue, 15 Jun 2021 22:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbhFPCVM (ORCPT ); Tue, 15 Jun 2021 22:21:12 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA7DC061574; Tue, 15 Jun 2021 19:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=cAFNJ1/DwVcSuyRvAwvNKZrXlrL9rYgK3W8Ic4ttV/8=; b=h4O7+9VsNWjBMVqH4uGscTf+2E Y+2KszH0xsTNWqZGX0xC9MYUJvqLb2pAiLbdOjKiZVhkzE7tqHF0vX8jqfw/ZijXQeDkKetDqhIt9 X+A8Zygmim6WYlRQYj1VwpQQ3d1q8wAb9m9eG50Ili2M+TPLOOfRVqr67mTOkXcT9yZxK8kgXU0kX 96Pds4lzKmFayRiubPf8iBDI/Su+E0mBRUD/H5pGxMllnbrWGRrXbvdofgqYfpwuyhAA8dcHunwpr 032dR/SFn2X90Y7pRZCexz4bxx1iYdSTIl5eV8nc4YNs1EVkHAD1+EtBZoYc1WD69pGQv8nodJsLC CpOYkazg==; Received: from [2601:1c0:6280:3f0::aefb] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltL8y-004Rdw-GO; Wed, 16 Jun 2021 02:19:04 +0000 Subject: Re: [PATCH] afs: fix no return statement in function returning non-void From: Randy Dunlap To: Linus Torvalds Cc: David Howells , Hulk Robot , Zheng Zengkai , Tom Rix , linux-afs@lists.infradead.org, Marc Dionne , linux-fsdevel , Linux Kernel Mailing List References: <162375813191.653958.11993495571264748407.stgit@warthog.procyon.org.uk> Message-ID: <07d62654-15c1-29a4-c671-1669ea92510b@infradead.org> Date: Tue, 15 Jun 2021 19:19:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/21 6:38 PM, Randy Dunlap wrote: > On 6/15/21 5:32 PM, Linus Torvalds wrote: >> On Tue, Jun 15, 2021 at 4:58 PM Randy Dunlap wrote: >>> >>> Some implementations of BUG() are macros, not functions, >> >> Not "some", I think. Most. >> >>> so "unreachable" is not applicable AFAIK. >> >> Sure it is. One common pattern is the x86 one: >> >> #define BUG() \ >> do { \ >> instrumentation_begin(); \ >> _BUG_FLAGS(ASM_UD2, 0); \ >> unreachable(); \ >> } while (0) > > duh. > >> and that "unreachable()" is exactly what I'm talking about. >> >> So I repeat: what completely broken compiler / config / architecture >> is it that needs that "return 0" after a BUG() statement? > > I have seen it on ia64 -- most likely GCC 9.3.0, but I'll have to > double check that. Nope, I cannot repro that now. I'll check a few more arches... >> Because that environment is broken, and the warning is bogus and wrong. >> >> It might not be the compiler. It might be some architecture that does >> this wrong. It might be some very particular configuration that does >> something bad and makes the "unreachable()" not work (or not exist). >> >> But *that* is the bug that should be fixed. Not adding a pointless and >> incorrect line that makes no sense, just to hide the real bug. -- ~Randy