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 E69D7395C02A for ; Sun, 18 Sep 2022 08:31:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E69D7395C02A 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=1663489879; 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=fIruQAuhqXzENMFKd3AYfBFTftfOsYgjN7mwYtIFurE=; b=ReOjTiH4/7LteYJBM+JBmaJlhCHWtlaeTXTuw9uGtc1MQqXIEBFX+yV4J54cTCb9dJerFD PaSnR2DtwE8CodwaVFIhiKB3b9Jx7MGQHpagkZo5ogjv8vvCb5dP0I8d+KhVHpP7LcXZ8z yqPqAYKytxrDx/rC9sXP/EMKFVynEUs= 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-651-U_AXWmUyNoefbcv9Ntmuxg-1; Sun, 18 Sep 2022 04:31:18 -0400 X-MC-Unique: U_AXWmUyNoefbcv9Ntmuxg-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 D5342101A52A; Sun, 18 Sep 2022 08:31:17 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBEB61121314; Sun, 18 Sep 2022 08:31:16 +0000 (UTC) From: Florian Weimer To: Joseph Myers Cc: Letu Ren , Subject: Re: [PATCH v2] stdlib/strfrom: Change -NAN test to multiple possible results (bug 29501) References: <20220917061328.8620-1-fantasquex@gmail.com> Date: Sun, 18 Sep 2022 10:31:14 +0200 In-Reply-To: (Joseph Myers's message of "Sun, 18 Sep 2022 05:32:19 +0000") Message-ID: <87tu5584od.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 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 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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: * Joseph Myers: > On Sat, 17 Sep 2022, Letu Ren via Libc-alpha wrote: > >> strfromf will convert the arguement with type float to double first. > > The *current implementation* will. That's not part of the specification, > it's a quality-of-implementation bug (IEEE 754 leaves the presence of a > sign for a NaN in the results of convertToDecimalCharacter and > convertToHexCharacter optional, but glibc ought to be consistent here > between types and architectures). That bug should be fixed; this patch > should not be applied. I think the conversion to double is required because according to the quote from ISO/IEC TS 18661-1:2014 in the bug, strfromf is defined in terms of snprintf, and calling snprintf promotes float arguments that do not correspond to a declared parameter to double as part of the default argument promotions. (Admittedly, this could be a bug in the TS.) Thanks, Florian