From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Mw08DB/vF2eOJxcAWB0awg (envelope-from ) for ; Tue, 22 Oct 2024 14:29:51 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OIKMPAU5; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 123141E0BB; Tue, 22 Oct 2024 14:29:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 autolearn=ham autolearn_force=no version=4.0.0 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 59CE01E05C for ; Tue, 22 Oct 2024 14:29:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E79353858402 for ; Tue, 22 Oct 2024 18:29:49 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 050543858C42 for ; Tue, 22 Oct 2024 18:29:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 050543858C42 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 050543858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729621752; cv=none; b=hg4EI+pOhbq1HvxFAap327UfSY1fZgwAJNjaId0h/wVQpdmXmucbCr7TGVk5gJStGEJ6CWmZjkYpt/CB60mH0L8H9U5kjaMCOJCIDnEDuLyZSRNjxRbyO16TvfJbMdunCPYG0x3mLLummlE5SkoPoeAXmQj+knmviWXYqnE3cGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729621752; c=relaxed/simple; bh=pFXBZAbh2dCLBfxqN+AU9yzAtFqWs3lOVUogiJVQjEg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=qgN6TOH9J9oUoDd/V66ITRk0p7Xy1btxLYf8ldjN8zvYlLwTMYos8RZayufbHj2cjlSk7YPRWzg8/4Nzx228qWa3AtuaKsZBolUuJ8zqynyMFTr0tymGVsn7eWpq47byelsgN9irLVnaVAWsqGVNNmGvshrIhEOWkAteNvjxHTM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729621747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o0w5SmQXqJf4UbXsi82c8xNnW4rAAuOl4bWZa9L/QjI=; b=OIKMPAU5ulvDN4KfdLsSreIO5xC97NTEMrAGKZvb0f3M/jCDRvqhHFGS89hh6HQ2ZEKa3X fbIwX+H6aVqWg7ntu5JIcEZEG5vkHInOI51dq0dEx0L11SZxaZ5B19QWhgpxJAeKOhRf6Z N+VRCGAF78rTq+BfXVmAgxAsmqvad2Y= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-Nij9kH8wMQ6zXLPbQXxjIA-1; Tue, 22 Oct 2024 14:29:02 -0400 X-MC-Unique: Nij9kH8wMQ6zXLPbQXxjIA-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7b144a054baso34753785a.0 for ; Tue, 22 Oct 2024 11:29:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729621742; x=1730226542; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o0w5SmQXqJf4UbXsi82c8xNnW4rAAuOl4bWZa9L/QjI=; b=RJrxPhCQIFfTea5ju+slgqbzYRnDlQ0bCY49sproATHynKyGTQ7hNHQ1biqycWZM6y 19SX/dWvq/C2McKs4B2Jp0JYfdSEwRyI5HTPT6ZN9J0IQX9a5Qbcrw03plMaAZg74898 xOrGKFlOlsDFwyQnlKMtnaiU/9xNXiPx2SEROoT6RSEulSRPMIFnO4SVmolxnyCNMixy EDF8Ult1sT/rA8mkBWr+2kSWisFUPyI1omdoec+h2Ua4R62xtf2Cw3/G4yck/uQ66hk8 qczvfRvLte++URla+gUaCJazPPHuc89x3LVNw2Iic0K9CQRK2xhVvS6fIM0/fGKHgzX1 czaQ== X-Forwarded-Encrypted: i=1; AJvYcCUz/toNHJKV54fqL8O5PGC20ECzJ4Tj4w1AT+RspYHaEM2AELwP6MNn6sUhdC/n7kKqkxUikt9jHXok2g==@sourceware.org X-Gm-Message-State: AOJu0Yz3UJOrn3kWT5QdOgj26sdh1HX6h1pjH3PscLE3IEycCrglynlp axci8Qe7bmWwkCO9MAJIfoWr5m5ZdYe5zgd/6RpRqXcKN5I7pXR3oi9sOkZziFAFY8qBm+9rvs7 +8Zwbp5zL8XWEq2z3DBG9APVZU2GvsAeoENVNA97ZWEq1Qf14zuw2IBqQ4d8UCr/0bno= X-Received: by 2002:a05:620a:29c1:b0:7b1:48d1:574d with SMTP id af79cd13be357-7b17e1b3ecemr12218985a.8.1729621742078; Tue, 22 Oct 2024 11:29:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE99TysE5Gp5QPtDQswmKq1CaBAJUn8rXKbS9wcbGdejtxj7hyvw0DkiptN9oL+6rUD/iiTjA== X-Received: by 2002:a05:620a:29c1:b0:7b1:48d1:574d with SMTP id af79cd13be357-7b17e1b3ecemr12216985a.8.1729621741798; Tue, 22 Oct 2024 11:29:01 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1000? ([2804:14d:8084:92c5::1000]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b165a06bacsm304418985a.67.2024.10.22.11.29.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Oct 2024 11:29:01 -0700 (PDT) Message-ID: Date: Tue, 22 Oct 2024 15:28:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix compile error due to [[noreturn]] with clang To: andrew@andrewoates.com, gdb-patches@sourceware.org References: <20241020180001.67425-1-andrew@andrewoates.com> From: Guinevere Larsen In-Reply-To: <20241020180001.67425-1-andrew@andrewoates.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 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. Also, from my little knowledge in this area, this sounds like a clang bug. I encourage you to report it to upstream clang, or I can do it myself if you'd prefer. -- Cheers, Guinevere Larsen She/Her/Hers > > Tested by compiling on macos both with the system clang, as well as with > GCC 14. With clang, remote-sim.c does not compile (per above) without > this patch. With GCC, it compiles with and without the patch (it > doesn't link, but AFAICT that is unrelated). > --- > include/sim/callback.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/sim/callback.h b/include/sim/callback.h > index f69f783abac..045ac3411af 100644 > --- a/include/sim/callback.h > +++ b/include/sim/callback.h > @@ -129,7 +129,7 @@ struct host_callback_struct > In the case of gdb "exiting" means doing a longjmp back to the main > command loop. */ > void (*error) (host_callback *, const char *, ...) > - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2; > + ATTRIBUTE_PRINTF_2; > > int last_errno; /* host format */ >