BUG: Bad Result If Call Inline Function Twice in ExpressionLast reviewed: July 24, 1997Article ID: Q135526 |
The information in this article applies to:
SYMPTOMSInvalid results may be generated under these conditions:
RESOLUTION
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.
Sample Code to Reproduce Problem
/* Compile options needed 32-bit Compiler: /Ob1, or /Ob2, or /Ox /* Compile options needed 16-bit Compiler: /Ob1g, or /Ob2g, or /Ox */ #include <stdio.h> int nGlobal = 0; inline int test(int nIn) { return nGlobal = nIn; } void main() { // This will incorrectly evaluate to true. if (test(1) == test(2)) printf("test(1) == test(2)\n"); else printf("test(1) != test(2)\n"); // This will correctly evaluate to false. int n = test(2); if (test(1) == n) printf("test(1) == test(2)\n"); else printf("test(1) != test(2)\n"); } |
Additional query words: 8.00c 9.00 9.10 10.00 10.10 10.20
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |