From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id B5C263858C54 for ; Sun, 18 Sep 2022 16:25:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B5C263858C54 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,325,1654588800"; d="scan'208";a="83052390" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 18 Sep 2022 08:25:45 -0800 IronPort-SDR: aNq6YodeoJ7V+lzBKxJvelwTsb1v6FZhxNp67wIqxFmBy3KbWYGDnvZlVWJreykdwyibPyqdlI CxbyTywZPTIgWuEkiX4onOYvqJhNPmZwifPl2pvFu16UOjGBTxc56vOBJv2urNLoKZ0uHnSzOh 7ooJbU3xHiO1YpTMGtUTkN4pCiKbhSoa8PSa/BPlDXM9UdAjAnFCpHXuYRpCVl+BelGLXSPEVT dvLMe5LNtmYzyURtnQjhYddTyB/fh73zf8DTSRI8xXLuiyz67EAkDfWwNBsAHKew5pvTxz46ZO NM0= Date: Sun, 18 Sep 2022 16:25:38 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Florian Weimer CC: Letu Ren , Subject: Re: [PATCH v2] stdlib/strfrom: Change -NAN test to multiple possible results (bug 29501) In-Reply-To: <87tu5584od.fsf@oldenburg.str.redhat.com> Message-ID: References: <20220917061328.8620-1-fantasquex@gmail.com> <87tu5584od.fsf@oldenburg.str.redhat.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3111.1 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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 Sun, 18 Sep 2022, Florian Weimer wrote: > 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. I don't think reading as literally passed to the variable-arguments function snprintf is very helpful, considering that the strfrom functions are supported for types that have no corresponding printf format (and supporting e.g. strfromf128 is one motivation for having these functions). That is, the equivalence to snprintf should be considered to be for the semantics of conversion to character strings, rather than for applying default argument promotions. -- Joseph S. Myers joseph@codesourcery.com