develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #132626] perl5 sprintf: wrong output on format %a

Thread Previous | Thread Next
From:
sisyphus1
Date:
December 20, 2017 13:05
Subject:
Re: [perl #132626] perl5 sprintf: wrong output on format %a
Message ID:
D9DB5F0D13784F048507408E19E67D46@OwnerPC311012
-----Original Message----- 
From: Wolf-Dietrich Moeller (via RT)
Sent: Wednesday, December 20, 2017 10:57 PM
To: bugs-bitbucket@rt.perl.org
Subject: [perl #132626] perl5 sprintf: wrong output on format %a

> # New Ticket Created by  Wolf-Dietrich Moeller
> # Please include the string:  [perl #132626]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=132626 >
>
>
> This is a bug report for perl from wolf-dietrich_moeller@t-online.de, 
> generated with the help of perlbug 1.40 running under perl 5.26.1.
>
>
> -----------------------------------------------------------------
> sprintf generates a wrong output for the format "%a".
> The test program below gives the output lines:
>
> 0x1.ep+4  30.000000  3.000000e+001  30
> 0x1.ep+4  0X1.EP+4  30.000000  30
>
> Line 1 shows the buggy result of "%a".
> Line 2 shows that under certain combinations of format
> parameters the bug even extends to the next parameter.
>
> ######## test program #########
> print sprintf("%a  %f  %e  %g\n",30,30,30,30);
> print sprintf("%a  %e  %f  %g\n",30,30,30,30);
> ######## end test program #####
> -----------------------------------------------------------------

I see the same on Strawberry 5.26.0 (gcc-7.1.0), and on my own mingw-w64 
build of 5.26.0 (gcc-7.2.0).

However, on my own build of 5.27.6 (gcc-7.2.0), the output of the test 
program is correct.

Since the only difference between my build of 5.26.0 and my build of 5.27.6 
is the perl source, I surmise that the perl source has already been patched 
to fix the bug.

Cheers,
Rob

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About