0

We have created a xml based script interpreter which assembles parts within a CAD system (VS2010, C++).

With German locale settings (comma as decimal separator) the DLL, compiled for release, fails while interpreting a float from the XML file. Seems like the remainder is cut off; a beam in CAD is 1m long (instead of 1.6m).

The same DLL compiled for debug and called from within VS2010 in debugging mode works ok, the beam is i.e. 1.6m long.

With Swiss locale settings (point as decimal separator) both modes (release and debug) work ok.

QT is not used in this part of the code, the xml file is read and interpreted 'manually' in C++, without using any QT functionality.

I did not find any hint to such a bug in VS2010 (or MS runtime libraries).

Anyone experienced a problem like this? I greatly would appreciate help, thanks in advance.

MLandgraf
  • 15
  • 1
  • 7
  • You are relying on the implicit thread locale. That's never a good idea when reading a locale-invariant file format (like XML). The solution is to explicitly set the appropriate locale on the thread that reads the XML file. – IInspectable May 30 '17 at 15:09
  • You are right, we will improve the code and thank you for your hint. However, this does not explain the behavior - Generally I would expect such basic functions/methods to behave identically in Debug and Release mode. – MLandgraf May 30 '17 at 17:05
  • 2
    You aren't contrasting the same setup, though. It seems that you are running the release configuration of the DLL from your application, while you are accessing the debug configuration through Visual Studio (a test project, maybe). That *could* explain the difference. – IInspectable May 30 '17 at 17:18
  • Valid Remark. So we have verified today: Calling the DLL compiled for release or for debug configuration directly from Visual Studio 2010 leads to the same, strange behavior. – MLandgraf May 31 '17 at 20:41

0 Answers0