NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59749: awk bad test to see if printf supports the %a format



The following reply was made to PR bin/59749; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/59749: awk bad test to see if printf supports the %a format
Date: Thu, 6 Nov 2025 17:22:44 +0100

 On Thu, Nov 06, 2025 at 03:40:01PM +0000,  via gnats wrote:
 >   #include <stdio.h>
 >   
 >   int
 >   main(void)
 >   {
 >            char xbuf[100];
 >            snprintf(xbuf, sizeof(xbuf), "%a", 42.0);
 >            printf("%s\n", xbuf);
 >            return 0;
 >   }
 >   
 >   prints 0x1.5p+5, so the code as is in awk works?
 
 The windows UCRT seems to get this wrong (according to godbolt.org), while
 all unixish environments seem to get it right.
 
 Martin
 


Home | Main Index | Thread Index | Old Index