delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/04/19/11:18:07

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BB53C3945C25
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=SystematicSw.ab.ca
Authentication-Results: sourceware.org;
spf=none smtp.mailfrom=brian DOT inglis AT systematicsw DOT ab DOT ca
X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=607d9f1d
a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17
a=IkcTkHD0fZMA:10 a=CCpqsmhAAAAA:8 a=aJUhP96EdMSyC2PgTPwA:9 a=QEXdDO2ut3YA:10
a=ul9cdbp4aOFLsgKbc677:22
Subject: Re: should scanf be getting built supporting hexadecimal float
To: cygwin AT cygwin DOT com
References: <CAAHpriMYTdJo5qFkN1y97wZVdx-ZkuggNrxHijiZdROwY_OEFg AT mail DOT gmail DOT com>
<189e0004-0cee-0e1d-2c2f-0acd7d8ca2fb AT SystematicSw DOT ab DOT ca>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Organization: Systematic Software
Message-ID: <91cf4bdd-9a97-6d6b-73af-01e891c22182@SystematicSw.ab.ca>
Date: Mon, 19 Apr 2021 09:17:48 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.9.1
MIME-Version: 1.0
In-Reply-To: <189e0004-0cee-0e1d-2c2f-0acd7d8ca2fb@SystematicSw.ab.ca>
X-CMAE-Envelope: MS4xfARcLocD44IOI6XBdbyY8SLX87qqJHVP34HTauy9br7zpv+IyPRoYwMp9+RJ0JoQQr4zR/bznQd2J3lJc+4jBCSehUvhMYSMkCaLtF2fIb0eRGV7CeSP
0GCR6EFhArmJ2nhPkTt2TMV2hryaJ0tqh4t5xofDbMSVkQvmiDW9ShPPtYdo6mxUkk3h1Rp9T+z+/m6lXXLol9j2Np22YAciNRo=
X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL,
RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On 2021-04-19 09:07, Brian Inglis wrote:
> On 2021-04-18 22:09, Keith Thompson via Cygwin wrote:
>> The *scanf() functions don't handle hexadecimal floating-point input
>> (for example "0x1p+0" representing 1.0).
>> On Cygwin, the output (compiled with gcc or clang) is:
>> sscanf returned 1, x = 0 (expected 1), FAILED
>> On Ubuntu, the output is:
>> sscanf returned 1, x = 1, PASSED
>> Looking through the newlib sources (git://sourceware.org/git/newlib-cygwin.git),
>> this might be related to the _WANT_IO_C99_FORMATS macro, but I haven't
>> looked into
>> the details.
>> The test case passes on Cygwin when compiled with i686-w64-mingw32-gcc
>> or x86_64-w64-mingw32-gcc.

> This seems like an oversight as gdtoa-gethex.c was added about 2006 and scanf 
> and strtod support it.
> See augmented STC with strtod added attached:
> 
> $ gcc -o hexfloat-scanf-test{,.c}
> $ ./hexfloat-scanf-test
> sscanf returned 2, unscanned 'x1p+0', x = 0 (expected 1), FAILED
> strtod unscanned '', x = 1, PASSED

Should the Cygwin newlib build be enabling hex float support?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019