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.133.124]) by sourceware.org (Postfix) with ESMTPS id 111053870886 for ; Wed, 16 Mar 2022 16:26:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 111053870886 Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594--4_KCjt8NNu7AJAC_kQBrw-1; Wed, 16 Mar 2022 12:26:57 -0400 X-MC-Unique: -4_KCjt8NNu7AJAC_kQBrw-1 Received: by mail-yb1-f198.google.com with SMTP id j133-20020a25d28b000000b006337bb01016so2333436ybg.11 for ; Wed, 16 Mar 2022 09:26:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/8KfDQeO8FP9trJair/21PneiZqybdCiESziTkT5Lus=; b=We8QEYjCSFoiTZaXUUFBM/Y7KXbPsodl5cT2zl8GHUnTzR3NLmi7rpz3dQmR3HVyT+ 1lwhxrO2+GtcqLAxuV6KmPe7zLI9XLfrWp4GtnEpW8eVVHUpxPbf9gMbeQFYbRkyGEoZ 9fbandbGIM+AUzmCikeJoRkcHJ4QKOXlOi6nC/ljtSYx7YDD8NeyAdxW6zBNn9kuzO3C U0daKe9RBx9W+/o3YUVIeZamwA+PuPRTRd8/kR5XBlPfNJdx670gnbZEfl98+afLHBR2 Kdr5VHjHONN/79RQhn4GqN4kn6SxVp36UbpHq7B+QL3Ep5TV2c0xIXZE/FgCXa46Ewkf InJQ== X-Gm-Message-State: AOAM530PA9PtYpDjuGCEP7mQpP+Y9gQex5c0iRRPhKMVGStwftlzK3CP GQHxbRCtgXqgDxQpNMOugIZipKq1ykrN726SpSJ4ylS2DhHYMAsJHs/ZHlc3EvB9pRipspnAvtD tMdcavi29fZmrQiCRvNMT9V+t1QPcbL3Plg== X-Received: by 2002:a25:8891:0:b0:624:689e:cf27 with SMTP id d17-20020a258891000000b00624689ecf27mr689410ybl.551.1647448017178; Wed, 16 Mar 2022 09:26:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjyJSj52Q5zasK2CyUuqaRI3a0f6lmsTFfP9hcQBf1DObfYiEZpkf66g/9vSqw8XSeJCbJG/2ho11G9laQkh0= X-Received: by 2002:a25:8891:0:b0:624:689e:cf27 with SMTP id d17-20020a258891000000b00624689ecf27mr689391ybl.551.1647448016984; Wed, 16 Mar 2022 09:26:56 -0700 (PDT) MIME-Version: 1.0 References: <20220311183244.1861699-1-jwakely@redhat.com> <8386f1e0-d179-3a09-16f1-0c1136247018@idea> In-Reply-To: <8386f1e0-d179-3a09-16f1-0c1136247018@idea> From: Jonathan Wakely Date: Wed, 16 Mar 2022 16:26:46 +0000 Message-ID: Subject: Re: [PATCH] libstdc++: Ensure that std::from_chars is declared when supported To: Patrick Palka Cc: Jonathan Wakely , "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 16:27:00 -0000 On Tue, 15 Mar 2022 at 14:12, Patrick Palka wrote: > > On Mon, 14 Mar 2022, Jonathan Wakely wrote: > > > On Mon, 14 Mar 2022 at 14:17, Patrick Palka via Libstdc++ > > wrote: > > > > > > On Fri, 11 Mar 2022, Jonathan Wakely wrote: > > > > > > > Patrick, I think this is right, but please take a look to double check. > > > > > > > > I think we should fix the feature-test macro conditions for gcc-11 too, > > > > although it's a bit more complicated there. It should depend on IEEE > > > > float and double *and* uselocale. We don't need the other changes on the > > > > branch. > > > > > > Don't we still depend on uselocale in GCC 12 for long double from_chars, > > > at least on targets where long double != binary64? > > > > Not after this patch: > > > > from_chars(const char* first, const char* last, long double& value, > > chars_format fmt) noexcept > > { > > -#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 \ > > - && ! USE_STRTOD_FOR_FROM_CHARS > > +#if ! USE_STRTOD_FOR_FROM_CHARS > > + // Either long double is the same as double, or we can't use strtold. > > + // In the latter case, this might give an incorrect result (e.g. values > > + // out of range of double give an error, even if they fit in long double). > > > > If uselocale isn't available, this defines the long double overload in > > terms of the double one, even if that doesn't always give the right > > answers. That greatly simplifies the preprocessor conditions for when > > it's supported. If the float and double forms are present, so is the > > long double one. > > Ah sorry, I had overlooked that part of the patch. Makes sense and LGTM! Pushed to trunk now.