On 28/12/12 08:58, Eli Zaretskii wrote:
From: <sisyphus1@optusnet.com.au>
Date: Fri, 28 Dec 2012 19:47:41 +1100

I'm using a gcc-4.7.0 binary that I downloaded from mingw.org a month or two 
back - as mingw-get-inst-20120426.exe, I think.
The 'gcc -v' for it is provided below my sig.
I think there's a newer GCC now, but if your problem is with mingwrt,
installing that won't solve the problem.

Is there a suitable mingwrt that I can download and install over the top of 
the existing installation ?
That would be my preferred option.

How would I tell beforehand whether that binary has been built with 
INFNAN_CHECK ? ... or would I just have to try it out and see ?
The latter, I guess.  Unless whoever built it will step forward and
tell for sure.


Such poorly-defined semantics are why the proponents of 'defensive' programming regard strtod (and similar functions) as unsafe.

My two pennyworth: I would suggest writing your own wrapper around strtod following the suggestions at http://pubs.opengroup.org/onlinepubs/007904975/functions/strtod.html. "Since 0 is returned on error and is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call strtod(), strtof(), or strtold(), then check errno". The wrapper can, of course, also check for infinity and nan. That way, you are insulated from whether somebody has defined a flag (or not) when building a library function.

Out of interest, what are the errno behaviours of the two versions?

P.