From nobody Thu Aug 08 19:00:19 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WfxFL62bDz5S131 for ; Thu, 08 Aug 2024 19:00:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfxFL5V83z4gmQ; Thu, 8 Aug 2024 19:00:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723143622; 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=+w05ckM3pN7gNMNG7txdyR++PTAh+FGSc63iQv2IMGY=; b=YAztfnPfjWvN3QUPDLPVtyFzJPsoq+YGl9/T4M200EUWyJbZwp6q7HaiylvacR1qgWIJBV I/j3zzAPcTrffvt1BxLylFf2/g2ZMbgucLlAu8GY6b5avb3CVsaB5/JUluaJYLXsF2CQax e+bDisKG1WZkXSlRlUZhilMULoL43R0Ka0LBBmWFX1RTXZ5PzvTP3QV9zlQMtonpDY5k2B ecy0zBIt29mobsezWQwBG6EJjgV470IYGDNyL8njTjOQPApJLKjiHlKIBG44Fl7RmRVjem 1otpSVoagbV3g4tv8qOu4czWPAAHhrpdq7TNyx72xvAIidnKD9RAubqk5BwkFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723143622; a=rsa-sha256; cv=none; b=rngqB19CjQeCvnl/cSaNJIXSeVIlvDXXQ/DdOqVJYSyMkkouV+Fcc/fquZABKYp22cCETU 7XEMAXJ2Qp610ctFC7NwhiBpRX+0Puy5RB9vWSf+D6+wg8iNyGul9XS6e0vE4+VlLOqMFZ vBCS7aJVB1zlszT0FZtr8/undTsMcAIVTvK/IWgK0eT6lc6uUy5Z9VJvnAHET4GxkqaMCC LJwYbhScpZ9z/2+mqX7WKfI5Jr+UfIE03MyiW9Dgb8S5ARhfHwKJA496pPmb+0cd7pvi0I 7YYfU+XLytKOW0TQuoi6GQdLY5siO2ytR5oxa1MbybDe3oyHJ+WS5LnacWUWhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723143622; 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=+w05ckM3pN7gNMNG7txdyR++PTAh+FGSc63iQv2IMGY=; b=PBXax+mXn5jWwU8lzojQnkNuJfKfep6w0S2j0cZIsaUxZkgM8Ihu7fmt1ZmfedEEsaDRUG uUd80bHEIo/ZTGweqqbY0JZhOsNJkICPQKgHOkDYjfB5nvG6FTpqHAQT6nNzGP/qkA1p8F y4SX4rR9BgidiKgFbpCAdco+SQqTEeu6SUwjoeHKUFrHPZVLSObv7y8QMKgg/vMIYfgLB5 ipBT7+8R6GtjUjvsd8Liolg1G56/OGxjxakifFYGy6iBcx6QV+UoAVOq92dGD0NZjC6zqk psKSlks2rhgW4wcccJYLDSolDUMAAx+ubS9Be1Y8p6ezcAXm714aHZ6WrMPADw== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R11" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WfxFL4PkPz1KMy; Thu, 8 Aug 2024 19:00:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow-wifi.home.andric.com [192.168.0.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2ED005880F; Thu, 08 Aug 2024 21:00:20 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.2\)) Subject: Re: Fall back to fast_float when C++ stdlib doesn't provide from_chars for floats From: Dimitry Andric In-Reply-To: Date: Thu, 8 Aug 2024 21:00:19 +0200 Cc: freebsd-current@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <9C549977-BC84-4B46-9F11-2EE70CF4CF27@FreeBSD.org> References: To: Daniel Tameling X-Mailer: Apple Mail (2.3731.700.6.1.2) On 8 Aug 2024, at 19:56, Daniel Tameling wrote: > > On Tue, Aug 06, 2024 at 11:26:26AM +0100, Nuno Teixeira wrote: >> >> As I don't have skills to understand why this fix works, I'd like to have >> some expert opinion on this fix since I don't know if this will be >> supported in the future. > > Not an expert, but here is my opinion: the workaround uses the strtod > function instead of the from_chars function. The latter got added in > c++17 and the former is still in the latest standard, and I don't > think it will be removed any time soon. So as long as it is supported > by upstream, it should be save to use the workaround. > > You might want to raise the issue with toolchain@FreeBSD.org to get a > reaction from the real experts. Maybe there is a better solution to > your problem. At the moment, from_chars is only implemented for integers, in libc++. I'm unsure what the reason is for not implementing it for floating point types. So for now, just use strtod() or the equivalent. -Dimitry