From: LRN <lr...@gm...> - 2012-12-28 07:23:16
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 28.12.2012 11:01, sis...@op... wrote: > Hi, > > The demo program: > > ################################# #include <stdio.h> #include > <stdlib.h> > > int main(void) { char * s = "inf"; char *endp; double z; > > z = strtod(s, &endp); > > printf("%f\n", z); > > return 0; } > > ################################# > > I build that program with: gcc -o strtod.exe strtod.c > > When I build that with the mingw.org port of gcc-4.5.2 strtod.exe > outputs 1.#INF00. When I build that with the mingw.org port of > gcc-4.7.0 strtod.exe outputs 0.000000. > > Why did this change ? Is there something I forgot to do when I > upgraded ? > > I much prefer that this 4.7.0 compiler (and the perls that I build > with it) would numify "inf" and "nan" strings to infinity and NaN > respectively - not to zero. > > What are the options I have for getting the behaviour that I prefer > ? > If mingwrt was compiled without INFNAN_CHECK, and if it's mingwrt that provides strtod for you (it's difficult for me to tell, but most likely it is), then there's nothing you can do, short of re-building mingwrt. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBAgAGBQJQ3UigAAoJEOs4Jb6SI2CwiaIIAOHrjiEqv1oUtWDgZIbGhMJJ IZQq8ZRMlD+kLA1DWg9f63fDfdqL8DeoS5sMBHaklG+Vxr8b0WZae7KBwlwqhjxm 0vu+XQjjL0MAUb5NChIL1jWyEUwsaqvYWNkYUkCzjW3MplJFVRHwNLBED399mkm0 4++K1mQbV9DUAuFj+clvdjxuLbdN6p+kp+ej63owQ8eWM55Ni2BwwrjjXQYFrH5V eJ11GzFyt23W1LdSARkFEwGCgK3rIFRbbVEGEPs6ERABl0vmR8KdyZy+RwOcCHcm B+Q+dRhE45yWHhGI2e9cMRTqirbV9SyHOwtrDZEY0TZMbU7Et9r3LWULjHJFu0Q= =lvdb -----END PGP SIGNATURE----- |