Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp222437lqg; Thu, 11 Apr 2024 00:05:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbDNd77FZwKC0KM6LF0obkTDPGPQcRSTTtno+NamttM53pWubgpBjs6cwpEpUuDvo1MF0SFqk7ulmGIkg5NHxvtvRrA5Z+lPBGWnqGhw== X-Google-Smtp-Source: AGHT+IFgggoFpdDqPgzI/dukJpz3wFfpmPGboDF6lZxlWwhFeX8NkP203x7a7KlO6/FxH/9FDKAj X-Received: by 2002:a25:ac60:0:b0:de0:e383:3c17 with SMTP id r32-20020a25ac60000000b00de0e3833c17mr5084718ybd.34.1712819129117; Thu, 11 Apr 2024 00:05:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712819129; cv=pass; d=google.com; s=arc-20160816; b=n10RvS7ta85hpA4Qedma4ONKmIKNL2LWcPcebATiHvp244mskpj07xZg9jc6mHgyym jNM6o7wWZUMDSdqKMJnU8gbJpCXtIqjWaZAOTnM5TfAKusNVu9f5ZCXAwjx1rgcXjvT5 Rwi6cmpZJB3ZqkpfW6ydQDmqiPQp4Q9gsiNMVGl0wIolov3YX/FEEVD0zaJqcBMu5C0T Pgmrj5ivmcpnx+gPRdDhHs9ekD+gbsjzevhBx2yDFndh2WLuO6Nq+9Bak5czCNydi7Ut EM9OBDXIXz9LqQ1r6hV6zHomU4dNiD3lbBiTFh6eKsfQciQrKAvx2yhogu+h6VlNhOoW dArA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=0R8ETRF6202lFso/GqWWlr/9xraGDGSFm0XJFifGRw0=; fh=gZDeVTLaDN1WzVQW7r6TT3DW2BSLfyVP00lEjNvu4qI=; b=l3MHGJt5Wkc/4WDuyvQvb+ii6kyUHbbDIkXBeZGIfRqobBtiKalejbK6y23W8F0GAv UOwzPHdy4THeMwt+QtKyVlvFzULqVKciUznIp65ico+GS5uwo388ogCvnUr98NT+C+i9 3dr0iG6pkpY6MTc77oLQYYkTV2bSf00ogCioeu1keOsWpFhEhTfUJOurZVV1fAlL5FU0 /AtMi7QrhofWxAoqxEln89iHfYv/9Z2a5nCZH6BhdViDCk6/Y66XatvpAkNtEJrEj0VO OIv6AjuiZhxZZfAl1PWvVZAEdsY54vRZ8j9E/q61t1zFID2nb+0lNbpZYBtSYdkVFv4t EG/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=nCoMyMQq; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=lWfIK3An; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-139913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 14-20020ac8590e000000b004365c3b667dsi962423qty.110.2024.04.11.00.05.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 00:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=nCoMyMQq; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=lWfIK3An; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-139913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C605A1C21A08 for ; Thu, 11 Apr 2024 07:05:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1426413DDB3; Thu, 11 Apr 2024 07:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="nCoMyMQq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lWfIK3An" Received: from wfhigh4-smtp.messagingengine.com (wfhigh4-smtp.messagingengine.com [64.147.123.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F87D13D63E; Thu, 11 Apr 2024 07:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819119; cv=none; b=Kl2WThw8PP2B1X7XJ7sD9/UmUSv3qT444bpa2v7AeVFdHma51Qe+5NFPOhmqMqisra0iCoXIF5ucFG3UdTzbSd1eJiX5kgRjEe2mrkrqO6y/ouKbSfHuoZ4SnTxt8eMi633vrmNfETV/3kTtxCWI1dKEbLkuF6XUCAclJoRuswY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819119; c=relaxed/simple; bh=0nQ1s5nwgfAOp/8qHUz15n9xgeRuXdGY6luDYyMefqk=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=SgtqWAFjVotZsisBBBfoqmekfkGBsqtz+qnLJy0iDzgvZGU1Zb4YwdHHuLW5eO4mxaDGRHWhfZLd7yVHN+5Q2udrlbM3OAxWnoBht3zGla1U4W0tjQi6U3+bnaXlLu/nhKyGfp/1SjAhNggq1aRXAuekmNJhmVnGtqcdtpxagqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=nCoMyMQq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=lWfIK3An; arc=none smtp.client-ip=64.147.123.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id B7F8C18000E8; Thu, 11 Apr 2024 03:05:13 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 11 Apr 2024 03:05:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1712819113; x=1712905513; bh=0R8ETRF6202lFso/GqWWlr/9xraGDGSFm0XJFifGRw0=; b= nCoMyMQq0XWmXVKUNWJxBDvPSDAVJhd0HJr+9THx5qllv2piGTza6F6vc0lb7+Hh NOcfPv8+FkB5U1c1Xp2Zef/C1oRsybJz7Fue4j2TCCCtxTJxLW/Fr0XLziS+ofnM DzGqvPlcm5J4JgeC6ezccDjj1BYHUrudxEZbeTmBhoeUoLWrSfUTHsfylwbHu4cY CzlEXOCrFHrlqdYXYWBxTkjtoxjPTakGnaQHpq/lVoTof2OHQqzL0vbBxIVO1JXH 0W2QsGe4bXf+u5q89ynFY4hljhg+ovqv8qKunly5D8CeW9RCLQjcTTPEb6+vQVWP ssARpsDZVMLTWg+Y3x3kxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712819113; x= 1712905513; bh=0R8ETRF6202lFso/GqWWlr/9xraGDGSFm0XJFifGRw0=; b=l WfIK3Ani950kaPDZ76durVahYSqY9YXccfZ2GtEHt2QMNiQl0QzqpBZtsNg8La4O hrVE/UO8tDSkCcXHqHdZUvW+ku4yLwCUIskbeGS8qOCh7u3KWiEfFRffaruRiDVR CnEZKM17Zut8zhk61exiVcY66tEXYfDRT9Qt36uaFI/AWC2oHx3ag0IavcbfpMGU 53jKQqtJk4FYs/7uwI9IEYT0F5wFXaCcWFxYbQ4ovjMgikfEa/MJwpYOsTR10vTU Yqb+nPD8aYCoRdNben2Ketdmx2W1FdeI253ZWdiUt1FswIpP9j930vxPUnSz7Cj+ YsI3n40oan7Oc+ZN9dBRQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehjedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedf tehrnhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrf grthhtvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudek tdfgjeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 18C03B60092; Thu, 11 Apr 2024 03:05:12 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-379-gabd37849b7-fm-20240408.001-gabd37849 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <87be83da-6102-483d-b1dc-a77eecc9f780@app.fastmail.com> In-Reply-To: <20240410153212.127477-1-adrian.hunter@intel.com> References: <20240410153212.127477-1-adrian.hunter@intel.com> Date: Thu, 11 Apr 2024 09:04:50 +0200 From: "Arnd Bergmann" To: "Adrian Hunter" , "Thomas Gleixner" Cc: "Naresh Kamboju" , "Michael Ellerman" , "Nicholas Piggin" , "Christophe Leroy" , "Aneesh Kumar K.V" , "Naveen N. Rao" , "Heiko Carstens" , "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" , "Sven Schnelle" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org, "H. Peter Anvin" , "Andy Lutomirski" , "Vincenzo Frascino" , "John Stultz" , "Stephen Boyd" , "Peter Zijlstra" , "Randy Dunlap" , "Bjorn Helgaas" , "Anna-Maria Gleixner" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH] bug: Fix no-return-statement warning with !CONFIG_BUG Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Apr 10, 2024, at 17:32, Adrian Hunter wrote: > BUG() does not return, and arch implementations of BUG() use unreachab= le() > or other non-returning code. However with !CONFIG_BUG, the default > implementation is often used instead, and that does not do that. x86 a= lways > uses its own implementation, but powerpc with !CONFIG_BUG gives a build > error: > > kernel/time/timekeeping.c: In function =E2=80=98timekeeping_debug_ge= t_ns=E2=80=99: > kernel/time/timekeeping.c:286:1: error: no return statement in funct= ion > returning non-void [-Werror=3Dreturn-type] > > Add unreachable() to default !CONFIG_BUG BUG() implementation. I'm a bit worried about this patch, since we have had problems with unreachable() inside of BUG() in the past, and as far as I can remember, the current version was the only one that actually did the right thing on all compilers. One problem with an unreachable() annotation here is that if a compiler misanalyses the endless loop, it can decide to throw out the entire code path leading up to it and just run into undefined behavior instead of printing a BUG() message. Do you know which compiler version show the warning above? Arnd