From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id BC7AB3830356 for ; Sun, 18 Sep 2022 08:54:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC7AB3830356 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1035.google.com with SMTP id s14-20020a17090a6e4e00b0020057c70943so3955719pjm.1 for ; Sun, 18 Sep 2022 01:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=zWGCBq+TgcuJ+4qt6VrgNTrdKvWQCzZHdqr+/WAOArc=; b=iwo+HyTnJWbyFdLgRmAcspIaV0uKlK4hz8rvo5D5+EmsJF2faX49od7MNt4tTO3Qk4 zZWS9+mhBbU3p/NFBXHymSE/ehogeI7om1npbfmX5d2Ns928hyLbr1MwLnmFm8XAlNf5 sigh7a20SXItEY6k0vTVAmbhAeWVKuaiPVLYaRNUS6egeGfiI4nT0e1d3gj9GI89Uszd skoNFaxXDfoaZ8KKPDhtRheUctrjBGwI2IwHp9qnPqANEK5CcFRTD9J+JshsrcqxNQrE E4PVR3MBsKS4y+hNM6y/Aa6E0wrnOEVnjIh9I7vHqAfBknnscHLInpahcKlDk9tV/Ze5 o6BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=zWGCBq+TgcuJ+4qt6VrgNTrdKvWQCzZHdqr+/WAOArc=; b=Iyil/MI4FLvv23jXdCSW6lWmo76bEscfrgk2xnDpfHSBRlMU8hmObaCtUi4HqEVLY0 ozacRI+AFAroIZqgjSTbh+9kStxGn57Ae+Q+YPU4VqLroZ7QVjOcPISrFUIIO/4Sgsad O1N7YILTdWNMZ2V+2evRF73DIAwGNbNlj9BVxs6fVD0x4byoqVfGZfsHEiEaHZs+ScvG PkFY8wa8WkYa5sC6W4aV4PiGxxOuP2J7eGp+IPJFDekgdmHuB29OPrHUBKqNZS9m2xbW GEbzjGwYCZey9LG4/PbbFc1OG7eRBAn9Qc7Z0cSLjMCAxulXgHvIz8qKo+efnelv3k1N YmZA== X-Gm-Message-State: ACrzQf1as+YxHoLBKjLoJjvIIP4tTc29EtNbS5TU1uOLuTvyyK+tPFQH paVEf0tBgRndbvZHwjODliKbADPLGqFyGbcLJFI= X-Google-Smtp-Source: AMsMyM52tZTwjbd2J09Rboh4v/ii3ltBeyvOjN4yXKuKVWbZt4ksKLAUawdELDvyMCJPHNEMv6Ap79tRYJeJu4GisIk= X-Received: by 2002:a17:90b:2643:b0:1fb:707d:af1f with SMTP id pa3-20020a17090b264300b001fb707daf1fmr25182533pjb.7.1663491261724; Sun, 18 Sep 2022 01:54:21 -0700 (PDT) MIME-Version: 1.0 References: <20220917061328.8620-1-fantasquex@gmail.com> <87tu5584od.fsf@oldenburg.str.redhat.com> In-Reply-To: <87tu5584od.fsf@oldenburg.str.redhat.com> From: Letu Ren Date: Sun, 18 Sep 2022 16:54:12 +0800 Message-ID: Subject: Re: [PATCH v2] stdlib/strfrom: Change -NAN test to multiple possible results (bug 29501) To: Florian Weimer Cc: Joseph Myers , libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On Sun, Sep 18, 2022 at 4:31 PM 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. > > (Admittedly, this could be a bug in the TS.) I agree with you that the conversion is required. The problem is that those standards don't define whether we should keep the signbit of -NAN explicitly. Joseph thinks we should keep the behavior of glibc consistent across different architectures and keep the signbit explicitly, while I think the signbit doesn't really matter originally. Since I'm not familiar with glibc, I would like to hear from more people. How do you think this problem should be solved? Just like what Joseph says or something else? Thanks, Letu Ren