Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10994

strtod returns 0 after constructing a QApplication in Qt4.6.2 on MacOSX 10.5.8

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.6.2
    • Core: Locales (i18n)
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            rmerks Roeland Merks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes