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 744FE3851152 for ; Fri, 28 Oct 2022 14:55:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 744FE3851152 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=1666968910; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wKKNCQblHQp3WTx818DbSakBM7cFf4szwxAwZHmVnUY=; b=AeTenMKJgmkhtTJF0KQVtCL8su6QottkzbCiYewMJhE2jrT274Gdys/ujtw2HORb07tiXU NPpdy5d6dHdg7hpbOw1r7oQdADpBT/yxxgcBjJxgO5KVc022Gt6yBg0coYu2fm381bZWU4 dj1lqqmwgmmyEOxFKGlgmh/w/YDPaXE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-_eWOkZsGPNm-UEHBsfHmUw-1; Fri, 28 Oct 2022 10:55:06 -0400 X-MC-Unique: _eWOkZsGPNm-UEHBsfHmUw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7844B833A20; Fri, 28 Oct 2022 14:55:06 +0000 (UTC) Received: from localhost (unknown [10.33.37.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C99D1121325; Fri, 28 Oct 2022 14:55:06 +0000 (UTC) Date: Fri, 28 Oct 2022 15:55:05 +0100 From: Jonathan Wakely To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] libstdc++: Don't use gstdint.h anymore Message-ID: References: <20221020142019.2418744-1-arsen@aarsen.me> MIME-Version: 1.0 In-Reply-To: <20221020142019.2418744-1-arsen@aarsen.me> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On 20/10/22 16:20 +0200, Arsen Arsenović wrote: >libstdc++-v3/ChangeLog: > > * configure.ac: Stop generating gstdint.h. > * src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h. >--- > >> > +using guintptr_t = __UINTPTR_TYPE__; >> >> I think this should be local in the only function that uses it. >Sure. > >Tested on x86_64-pc-linux-gnu. Thanks, I'll test and push this. > libstdc++-v3/configure.ac | 6 ------ > libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 8 ++++---- > 2 files changed, 4 insertions(+), 10 deletions(-) > >diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac >index 81d914b434a..c5ec976c026 100644 >--- a/libstdc++-v3/configure.ac >+++ b/libstdc++-v3/configure.ac >@@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO > > GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])]) > >-if test "$is_hosted" = yes; then >-# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to >-# use instead of . >-GCC_HEADER_STDINT(include/gstdint.h) >-fi >- > GLIBCXX_ENABLE_SYMVERS([yes]) > AC_SUBST(libtool_VERSION) > >diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc >index 5a0c5459088..e21bd76245d 100644 >--- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc >+++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc >@@ -22,7 +22,6 @@ > // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see > // . > >-#include "gstdint.h" > #include > #include > >@@ -119,13 +118,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > _GLIBCXX_CONST __atomic_flag_base* > __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW > { >- uintptr_t __u = reinterpret_cast(__z); >+ using guintptr_t = __UINTPTR_TYPE__; >+ guintptr_t __u = reinterpret_cast(__z); > __u += (__u >> 2) + (__u << 4); > __u += (__u >> 7) + (__u << 5); > __u += (__u >> 17) + (__u << 13); >- if (sizeof(uintptr_t) > 4) >+ if (sizeof(guintptr_t) > 4) > __u += (__u >> 31); >- __u &= ~((~uintptr_t(0)) << LOGSIZE); >+ __u &= ~((~guintptr_t(0)) << LOGSIZE); > return flag_table + __u; > } >