Skip Menu |
 

This queue is for tickets about the Perl-Dist-Strawberry CPAN distribution.

Report information
The Basics
Id: 62161
Status: resolved
Priority: 0/
Queue: Perl-Dist-Strawberry

People
Owner: Nobody in particular
Requestors: sisyphus [...] cpan.org
Cc: kmx [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: 'nan' and 'inf' not quite working right
Download (untitled) / with headers
text/plain 1.4k
I'm finding that recent perls (ie 5.8.9 to 5.12.2, with the exception of 5.10.0) built using mingw.org's compilers (gcc-3.4.5, gcc-4.5.0) produce (what I assume to be) intended output regarding numification of strings that match /^nan/i and /^inf/i: ######################### C:\>perl -wle "print 'nan' + 0" -1.#IND C:\>perl -wle "print 'InF' + 0" 1.#INF C:\>perl -wle "print 'NanN' + 0" Argument "NanN" isn't numeric in addition (+) at -e line 1. -1.#IND C:\>perl -wle "print 'iNff' + 0" Argument "iNff" isn't numeric in addition (+) at -e line 1. 1.#INF ######################### However, perls (such as Strawberry Perl) built using the mingw64.sf.net compilers don't get it quite right. They seem to recognize the strings as being numeric, but then numify them to zero: ######################### C:\>perl -wle "print 'nan' + 0" 0 C:\>perl -wle "print 'InF' + 0" 0 C:\>perl -wle "print 'NanN' + 0" Argument "NanN" isn't numeric in addition (+) at -e line 1. 0 C:\>perl -wle "print 'iNff' + 0" Argument "iNff" isn't numeric in addition (+) at -e line 1. 0 ######################### Is this something that the mingw64.sf.net compilers need to address ? I'm really not too sure where the goalposts stand in relation to this. I personally preferred it when strings like 'nan' and 'inf' were treated by Windows perls as being non-numeric, and numified to zero - at least, then, I knew where things stood. Cheers, Rob
Download (untitled) / with headers
text/plain 601b
On Fri Oct 15 06:07:30 2010, SISYPHUS wrote: Show quoted text
> Is this something that the mingw64.sf.net compilers need to address ?
I eventually raised this myself on the mingw64 mailing list. As of rev.3771 the release branch of the mingw64 compilers will have strtod() numify "nan" and "inf" strings in the same way as the mingw.org compilers. See the mingw64 mailing list archives for the discussion: http://search.gmane.org/?query=%22strtod+and+%27nan%27+and+%27inf% 27+strings%22&group=gmane.comp.gnu.mingw.w64.general (Entire thread not yet on the archive at time of posting this update.) Cheers, Rob
Show quoted text
> I eventually raised this myself on the mingw64 mailing list. As of
> rev.3771 the release branch of the mingw64 compilers will have strtod()
> numify "nan" and "inf" strings in the same way as the mingw.org
> compilers.

Thanks Rob for your effort.

Curtis, should I prepare a new gcc-toolchain packs for Strawberry's January Release?

--
kmx
Dirty fix for this should be getting

http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/branches/releases/v1.0/mingw-w64-headers/include/stdlib.h

and putting it into C:\strawberry\c\x86_64-w64-mingw32\include\stdlib.h (or corresponding place for 32-bit gcc)

Of course it is necessary to do this before building perl itself it does not help to replace this file in already installed strawberryperl.

--
kmx

RT-Send-CC: perl [...] csjewell.fastmail.us
Hi,

I have prepared micro-patched gcc toolchain packs (just changing single file stdlib.h)

64bit:
http://strawberryperl.com/package/kmx/64_gcctoolchain/mingw64-w64-20100123-kmx-v3.zip
http://strawberryperl.com/package/kmx/64_gcctoolchain/mingw64-w64-20100123-kmx-v3-lic.zip

32bit:
http://strawberryperl.com/package/kmx/32_gcctoolchain/mingw64-w32-20100123-kmx-v3.zip
http://strawberryperl.com/package/kmx/32_gcctoolchain/mingw64-w32-20100123-kmx-v3-lic.zip

According my test build of perl-5.12.3 (32bit) it fixes the issue.

Curtis, please consider using these updated versions for the next strawberry 5.12.x builds.

--
kmx
From: vvm [...] tut.by
Download (untitled) / with headers
text/plain 1.2k
On Thu Feb 17 06:32:37 2011, KMX wrote: Show quoted text
> I have prepared micro-patched gcc toolchain packs >(just changing single file stdlib.h)
Show quoted text
> 64bit: > /kmx/64_gcctoolchain/mingw64-w64-20100123-kmx-v3.zip
With: Strawberry Perl v5.12.3 x64 with GCC toolchain mingw64-w64- gcc4.4.6_20110503-v2.zip and kmx/64_libs 20110506.zip ( strawberry-perl-5.12.3.0-64bit-build-2011-06-09.zip / .msi ) ( Instruction for build: HowTo: Upgrade Strawberry Perl v5.12.3.0 x64 ( strawberry-perl-5.12.3.0- 64bit.zip) library to kmx/64_libs/5.14/*.zip and GCC toolchain to mingw64-w64-gcc4.4.6_20110503-v2.zip http://vvm.blog.tut.by/2011/06/09/howto-upgrade-strawberry-perl-v5-12-3- 0-x64-strawberry-perl-5-12-3-0-64bit-zip-library-to-kmx-64_libs-5-14- zip-and-gcc-toolchain-to-mingw64-w64-gcc4-4-6_20110503-v2-zip/ ) Screenshot: == C:\strawberry-perl-5.12.3.0-64bit-build-2011-06-09>perl - wle "print 'nan' + 0" -1.#IND C:\strawberry-perl-5.12.3.0-64bit-build-2011-06-09>perl - wle "print 'InF' + 0" 1.#INF C:\strawberry-perl-5.12.3.0-64bit-build-2011-06-09>perl - wle "print 'NanN' + 0" Argument "NanN" isn't numeric in addition (+) at -e line 1. -1.#IND C:\strawberry-perl-5.12.3.0-64bit-build-2011-06-09>perl - wle "print 'iNff' + 0" Argument "iNff" isn't numeric in addition (+) at -e line 1. 1.#INF ==
fixed in 5.14.2.1


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.