From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 09C3A3858C62 for ; Tue, 11 Jul 2023 15:22:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09C3A3858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689088933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y6jza943qhtJnmQbrq9fzMXlG49ym6BtBdey7uvMkKU=; b=FnQ+3NZKXsQlQBT+FFdWENrkHwPSN61LNQue4yA6Cx6LW6uhlS4Ox0WdPwQcA6TPw03iZR Wc7URBLFIukZCMzPbUOBJVmCtFXeVMlL58KaZfjIKq69LWa7OMSI/3OatNuPEtIofxzfIV zmxeOTfDwOaz5JXAMmfjzY1puhaqOrs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-159-27bmLvH-Mc2ae_z6u7sSRA-1; Tue, 11 Jul 2023 11:22:10 -0400 X-MC-Unique: 27bmLvH-Mc2ae_z6u7sSRA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34A7D3800521; Tue, 11 Jul 2023 15:20:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D8D34087C74; Tue, 11 Jul 2023 12:53:00 +0000 (UTC) From: Florian Weimer To: "Richard Earnshaw (lists)" Cc: gcc-patches@gcc.gnu.org, Szabolcs Nagy Subject: Re: [PATCH] aarch64: Fix warnings during libgcc build References: <875y6qeqma.fsf@oldenburg.str.redhat.com> <8cf00730-9c53-9e48-84bc-79bef86e0032@arm.com> Date: Tue, 11 Jul 2023 17:20:53 +0200 In-Reply-To: <8cf00730-9c53-9e48-84bc-79bef86e0032@arm.com> (Richard Earnshaw's message of "Tue, 11 Jul 2023 15:54:59 +0100") Message-ID: <87y1jma2zu.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Richard Earnshaw: > On 11/07/2023 10:37, Florian Weimer via Gcc-patches wrote: >> libgcc/ >> * config/aarch64/aarch64-unwind.h >> (aarch64_cie_signed_with_b_key): >> Add missing const qualifier. Cast from const unsigned char * >> to const char *. Use __builtin_strchr to avoid an implicit >> function declaration. >> * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state): >> Add missing cast. >> --- >> diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h >> index 00eba866049..93da7a9537d 100644 >> --- a/libgcc/config/aarch64/linux-unwind.h >> +++ b/libgcc/config/aarch64/linux-unwind.h >> @@ -77,7 +77,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context, >> } >> rt_ = context->cfa; >> - sc = &rt_->uc.uc_mcontext; >> + sc = (struct sigcontext *) &rt_->uc.uc_mcontext; >> /* This define duplicates the definition in aarch64.md */ >> #define SP_REGNUM 31 >> > > This looks somewhat dubious. I'm not particularly familiar with the > kernel headers, but a quick look suggests an mcontext_t is nothing > like a sigcontext_t. So isn't the cast just papering over some more > fundamental problem? I agree it looks dubious. Note that it's struct sigcontext, not (not-struct) sigcontext_t. I don't know why the uc_mcontext members aren't accessed directly, so I can't really write a good comment about it. Obviously it works quite well as-is. 8-) Similar code is present in many, many Linux targets. Thanks, Florian