"pack f NaN not-equals NaN" fails in t/op/infnan.t on VC6 #14705
Comments
From @bulk88Created by @bulk88Blead is failing with VC6, my first time testing it in a few months. IDK ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------ adding some debugging info, test numbers are different because I deleted ------------------------------------------------------------------------------------ for my $f (@packf_fmt) { ------------------------------------------------------------------------------------ Perl Info
|
From @bulk88Same modified infnan.t on VC7 start block at t/op/infnan.t line 314. Now a diff between vc6 (failing) and vc7 (passing) --- C:\perl521\vc6src\vc6.txt -- |
From @rjbsI reckon I'm willing to ship this with a skip, or even as a known problem, if needed, but: anybody have any ideas on a simple fix? -- |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Mon, May 18, 2015 at 07:13:18PM -0700, Ricardo SIGNES via RT wrote:
Well, it's an issue with "pack 'f', NaN" under VC6. Either its not - PV = 0xa53e84 "\0\0\200\377"\0 and on my linux/gcc system it's "\0\0\300\177"\0 The VC6 one is the IEEE 754 representation of -Inf, the VC7 (correct) one Someone with a VC6 system would have to debug it further (probably by If no-one can do that, then I'd suggest listing it as a known problem. -- |
From @bulk88On Tue May 19 02:38:43 2015, davem wrote:
Patch attached. I was originally hoping jhi who seems to now be inactive now wouldve figured it out and written a patch faster than I would have. -- |
From @bulk880001-fix-125203-pack-f-NAN-must-account-for-NAN_COMPARE_B.patchFrom eeb8eb6d1105e9ff711aac2dd3149c3e51ca243e Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Tue, 19 May 2015 13:22:40 -0400
Subject: [PATCH] fix #125203, pack('f', $NAN) must account for
NAN_COMPARE_BROKEN platforms
VC6 was returning either packed float +inf or packed float -inf
(I dont remember) instead of packed float NAN in t/op/infnan.t .
---
pp_pack.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/pp_pack.c b/pp_pack.c
index 1d732a8..cf1074e 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2672,6 +2672,11 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
afloat = -FLT_MAX;
else afloat = (float)anv;
# else
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+ if(Perl_isnan(anv))
+ afloat = (float)NV_NAN;
+ else
+#endif
/* a simple cast to float is undefined if outside
* the range of values that can be represented */
afloat = (float)(anv > FLT_MAX ? NV_INF :
--
1.7.9.msysgit.0
|
From @bulk88On Tue May 19 10:29:51 2015, bulk88 wrote:
Bump. -- |
From @steve-m-hayOn 20 May 2015 at 19:06, bulk88 via RT <perlbug-followup@perl.org> wrote:
The patch fixes the failing test for me, but it's not my call whether I also noticed in testing that porting\cmp_version.t is hanging in |
From @rjbs* Steve Hay <steve.m.hay@googlemail.com> [2015-05-20T20:04:31]
After look through the code, I have committed it. I will make an RC2 -- |
From @bulk88On Wed May 20 17:57:23 2015, perl.p5p@rjbs.manxome.org wrote:
Commited as http://perl5.git.perl.org/perl.git/commit/d22fb6ca0a489331fea369e4ab9a5d4013de1bb0 and released in 5.22. It is close time for this ticket, but I dont have perms to do it. -- |
From @rjbsthanks, resolved. -- |
@rjbs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#125203 (status was 'resolved')
Searchable as RT125203$
The text was updated successfully, but these errors were encountered: