From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qJ/LABL/F2dWNBcAWB0awg (envelope-from ) for ; Tue, 22 Oct 2024 15:37:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1729625873; bh=B9eRo/xj2+YLfJv8sXChPfPUoH+KnZ2xvebydB/2T4E=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XI0Gp1ovtsrunghj7am2GmVTDxTxyaK+M//TPDvOWY1ZlaNvNcKvkro21qO4BOZNo tzyotncX0AtxrIpk4D8aO0oWhPBvbT5zXo6iWAwqOyR+dAqmpdyMGlHcIrZ1Ht6uGF 5ItK2uRwc1HzCszRlQibFsrnW2PZAz5jxx6Zb8Xs= Received: by simark.ca (Postfix, from userid 112) id DB2D71E0BB; Tue, 22 Oct 2024 15:37:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=unavailable autolearn_force=no version=4.0.0 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=JctR3W6+; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=thjczYct; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 407F61E05C for ; Tue, 22 Oct 2024 15:37:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C99103858C50 for ; Tue, 22 Oct 2024 19:37:52 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 29ECC3858CD1 for ; Tue, 22 Oct 2024 19:37:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29ECC3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 29ECC3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729625852; cv=none; b=eTPfN8iEV1wlzhARWwL1vX1Vc1btap35IrQ3xhO1WWXlY8rVl9YsxBMvXB7B79/aehG6/sdGJXmEbNU6OoS7seWXGeGe0j1teeEHxNCFmRnOrGtaU55NnOjZrFkrFs/y1g88uFYA4ByAIXh/cwPTuaPdvFxdmVAxbagHuEL2pvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729625852; c=relaxed/simple; bh=B9eRo/xj2+YLfJv8sXChPfPUoH+KnZ2xvebydB/2T4E=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=PXghL6cpIGPPho1+iB3zIUHrljxYMYgW8MrUBzCIrutZk5fla2I2hXWrsL/SVCUcmC3NErImoFSmDfneqTRe1PjaugMokDn0DIG1FHSjHO8MR1BkhRgTic3Q6fz3tqYaAqyRtPA0yhkvtqczNDlpRuILq/LLHtYLcLPeqGLF5f8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1729625849; bh=B9eRo/xj2+YLfJv8sXChPfPUoH+KnZ2xvebydB/2T4E=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JctR3W6+d3EUitxRoZ71GBuNlM3/poUQLSA6TatVE005ShMmZyQsqGE8d4SFZQwvP 7J3tBMBzfgTsV1Hs0HR2QBfjOMvJNLdvK1pJeleUJqkb0yBaufeLXyNArEEJM8Mt1k 7xwEvfEFM6363tje3f3U9Lu1X1h6cQ9h9BYphtYk= Received: by simark.ca (Postfix, from userid 112) id 8E4AC1E05C; Tue, 22 Oct 2024 15:37:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1729625847; bh=B9eRo/xj2+YLfJv8sXChPfPUoH+KnZ2xvebydB/2T4E=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=thjczYctGUlGFZOfepVqkiiLqy0u+NnXegtMAaUUyFmzkNz+P02KnwBJqWr+6y719 /rrYAP0laI4zi1YL/PvD+WtbxnhMCq7BpUZhdEm52TEvgdjEpB2AseCQDC/kJLyF92 IO44Xq6i1//jnWp93DFGzGSxoE+Lx1yLXw78IpdY= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 74BDF1E05C; Tue, 22 Oct 2024 15:37:27 -0400 (EDT) Message-ID: Date: Tue, 22 Oct 2024 15:37:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix compile error due to [[noreturn]] with clang To: Guinevere Larsen , Andrew Oates Cc: gdb-patches@sourceware.org References: <20241020180001.67425-1-andrew@andrewoates.com> Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2024-10-22 15:10, Guinevere Larsen wrote: > On 10/22/24 3:50 PM, Andrew Oates wrote: >> >> >> On Tue, Oct 22, 2024 at 2:29 PM Guinevere Larsen wrote: >> >> On 10/20/24 3:00 PM, andrew@andrewoates.com wrote: >> > From: Andrew Oates >> > >> > Since commit d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3, I get the >> > following compiler error when building binutils (cross-compiling) on >> > macos: >> > >> > CXX remote-sim.o >> > ../../gdb/remote-sim.c:334:28: error: assigning to 'void (*)(host_callback *, const char *, ...) __attribute__((noreturn))' (aka 'void (*)(host_callback_struct *, const char *, ...) __attribute__((noreturn))') from incompatible type 'void (host_callback >> > *, const char *, ...)' (aka 'void (host_callback_struct *, const char *, ...)') >> > gdb_callback.error = gdb_os_error; >> > ^~~~~~~~~~~~ >> > 1 error generated. >> > >> > This appears to be due to the mismatch between ATTRIBUTE_NORETURN and >> > [[noreturn]] on gdb_os_error. Removing ATTTRIBUTE_NORETURN on the >> > declaration of host_callback::error resolves the issue. >> >> Have you tried using ATTRIBUTE_NORETURN for gdb_os_error instead? If the >> problem is the mismatch, I would prefer that we made them match over >> removing information for the compiler. >> >> >> gdb_os_error used to have ATTRIBUTE_NORETURN on it, but that was removed in favor of [[noreturn]] in commit d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3 (which seems to have done ATTRIBUTE_NORETURN -> [[noreturn]] through most of the codebase). >> >> I'm definitely not an expert here, but I agree that if there's a way to annotate the function pointer instead so it can be assigned to a [[noreturn]] function, that would be better. I tried doing that but couldn't make it work. > > Yeah, [[noreturn]] only works for functions, not meant to be used by members or variables, so this wouldn't work. We have to walk back the [[noreturn]] change for this function if we want to continue adding this information for the compiler. > > I added Simon on CC since he's the one who made the original commit you pointed to. My reading seems to be that the patch is meant to modernize the code and isn't driven by an actual need, so I would think walking back this specific change should be ok, but I'll defer to Simon on this. So, I can't reproduce the build failure when configuring with `--enable-targets=all --enable-sim`. It looks like remote-sim.o doesn't get built, which is odd given that the simulator is enabled. Sounds like a bug? When building GDB for the ARM target specifically, remote-sim.o does get built and I see the failure. Reverting to using the old attribute is fine with me, I don't see any other way around. Simon