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 99B6D3858D37 for ; Tue, 15 Mar 2022 14:12:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 99B6D3858D37 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-574-Zq9LKOUtNamybq2UzJxZqw-1; Tue, 15 Mar 2022 10:12:26 -0400 X-MC-Unique: Zq9LKOUtNamybq2UzJxZqw-1 Received: by mail-qt1-f198.google.com with SMTP id cb11-20020a05622a1f8b00b002e06f729debso14022669qtb.4 for ; Tue, 15 Mar 2022 07:12:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=FFu+seGXIW2bqKcUlOqIvUWMKu+Y5ufqLfYCCjqWiwo=; b=JaL0dnUqAEcvQrxya2KQmRXge1IJyL5KEVd0fa7x8pXELScwXjWlPizjf4MVzTPyAT Ly/j0N/IQh8qHVWSLl4VVxyNyqr/QCfn2FYx1FWIPnDzNGAVUGJXwPYPudon+85cFNrq 7aIjQr78UODcI+ijgPuS6a9x/2kjK93miGh7iyDne+OYZaalvSnWzcekroOsaauvPmh9 PJfptbvlu8/Y7DCqMUOyYinVQoGcMsZFPxMPerfw/52VKQ3OEEBw3W4fOCdi1s8cXGmR b9kuwiRWMi5thTgocR+kib604irf5gKKY/QmelTKsERqnKZ6S1Rh7Y/J/yKwTf0N4kfW Pk6g== X-Gm-Message-State: AOAM533vwM/sZolmvT7ceFHEjIELrwTsdvgTncZBTaI0WwQXGWQLN6sf iQUWabON6B/N3Qn6rxQwPi46UlzVQMb1Jf/CBBr2h9QzKH/zqGvKaSgoVEaBgZ+BGXvbHOccRii srvbrXvNoUPLty2Q= X-Received: by 2002:ae9:f501:0:b0:67b:2d97:93c5 with SMTP id o1-20020ae9f501000000b0067b2d9793c5mr18105779qkg.380.1647353545888; Tue, 15 Mar 2022 07:12:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3AZ9p8A3t7QzSIGmp9iC0jM/YBqGR0u4FLOiRazSBuBdRKLo1fhSupx59DAeWPhActJhhtw== X-Received: by 2002:ae9:f501:0:b0:67b:2d97:93c5 with SMTP id o1-20020ae9f501000000b0067b2d9793c5mr18105737qkg.380.1647353545308; Tue, 15 Mar 2022 07:12:25 -0700 (PDT) Received: from [192.168.1.130] (ool-18e40894.dyn.optonline.net. [24.228.8.148]) by smtp.gmail.com with ESMTPSA id g2-20020a37e202000000b00607e264a208sm9292963qki.40.2022.03.15.07.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 07:12:24 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Tue, 15 Mar 2022 10:12:23 -0400 (EDT) To: Jonathan Wakely cc: Patrick Palka , Jonathan Wakely , libstdc++ , gcc-patches Subject: Re: [PATCH] libstdc++: Ensure that std::from_chars is declared when supported In-Reply-To: Message-ID: <8386f1e0-d179-3a09-16f1-0c1136247018@idea> References: <20220311183244.1861699-1-jwakely@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.9 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=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 14:12:30 -0000 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!