BUG: Optimization Generates Incorrect Results for an Inline Function Returning double (243534)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q243534 SYMPTOMS
When a method of one class calls, as an input argument, an inline function that creates an object of another class and returns a double, the compiler may generate incorrect results.
CAUSE
This occurs when compiled with the /Ob1 (Only _inline) or /Ob2 (Any Suitable) optimizations turned on.
RESOLUTION
There are two possible ways to work around this problem:
- Compile the project with the /Ob1 (Only _inline) or /Ob2 (Any Suitable) optimizations turned off.
- Store the results of the function that is used as an input parameter in a temporary variable. Pass the temporary variable as the argument to the method of the class that returns a double.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kbBug kbCodeGen kbCompiler kbCPPonly kbnofix KB243534 |
---|
|