Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.6.2
-
None
-
Qt 4.6.2
MacOSX 10.5.8 (9L30)
Darwin 9.8.0
Description
Subject: strtod breaks down in Qt4.6.2
Dear Madam, Sir,
After constructing a QApplication object, the <stdlib.h> function "strtod" no longer returns correct values.
I have narrowed down the problem to the following piece of code:
#include <cstdlib> #include <QApplication> #include <iostream> using namespace std; int main(int argc, char *argv[]) { cerr << "strtod(0.1) = " << strtod("0.1",0) << endl; QApplication app(argc,argv); cerr << "strtod(0.1) = " << strtod("0.1",0) << endl; }
This code produces:
Laptop-van-Roeland-Merks-2:QtStrtoD roel$ ./QtStrtoD strtod(0.1) = 0.1 strtod(0.1) = 0
After constructing the qApp, strtod always seems to return 0.
I have only seen the problems on MacOSX with Qt4.6.2; we have compiled the same code on Windows and Linux, but I am unsure of the Qt versions right now (I can check it in detail tomorrow morning if needed). The problem is new - I have never seen it before on MacOSX (previous version of Qt / previous patch of MacOSX?)
Hope this is helpful. I look forward to hearing from you.
Best wishes,
Roeland Merks