From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) by sourceware.org (Postfix) with ESMTPS id BB53C3945C25 for ; Mon, 19 Apr 2021 15:17:50 +0000 (GMT) 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.inglis@systematicsw.ab.ca Received: from [192.168.1.104] ([68.147.0.90]) by shaw.ca with ESMTP id YVemlOPFqHmS3YVenluJtd; Mon, 19 Apr 2021 09:17:49 -0600 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 Reply-To: cygwin@cygwin.com Subject: Re: should scanf be getting built supporting hexadecimal float To: cygwin@cygwin.com References: <189e0004-0cee-0e1d-2c2f-0acd7d8ca2fb@SystematicSw.ab.ca> From: Brian Inglis 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> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 15:18:01 -0000 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.]