BUG: Evaluating _pascal Functions Can Give Erroneous CXX0039Last reviewed: July 22, 1997Article ID: Q116421 |
4.00 4.01 4.10 | 4.00 4.01 4.10
MS-DOS | WINDOWSkbtool kbbuglist The information in this article applies to:
SYMPTOMSEvaluating functions declared with the _pascal calling convention in the Codeview command window using either the C or C++ Expression Evaluator can cause the following error:
CXX0039: Error Symbol is ambiguousThis occurs even when the symbol is not ambiguous, although the decorated name of the symbol is the same as its undecorated name. Note that this problem can also occur with mixed case _pascal declared names if they are exported with their mixed case names in a .DEF file. This would be incorrect since the .DEF file is not using the correctly decorated name, but if /NOI is not specified when linking, no error is given.
RESOLUTIONAvoid using all uppercase letters in functions declared with the _pascal calling convention. Then, turn on Codeview's case sensitivity before evaluating these functions in the command window. In the case of exported functions mentioned above, be sure to use the fully decorated name in the .DEF file. If you are unsure what they are, use the linker /MAP option to have the linker generate a .map file. This file contains the symbol names after they have been decorated.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe sample code listed below can be used to illustrate the problem. To do this, build a debug version of the program, start a debugging session in Codeview, and enter the following commands in the Codeview command window:
t2 trace into main oc+ turn on case sensitivity ? FUNC2() the CXX0039 error is generated. ? Func1() no error; the function is evaluated oc- ? Func1() the error is generated ? Func1 always works ? FUNC2 always works Sample Code
/* Compile options needed: /Zi /Od */ #include <stdio.h> void _pascal Func1(void){ printf("First _pascal function.\n");}
void _pascal FUNC2(void){ printf("Second _pascal function.\n");}
void main(void){ printf("Hello World.\n");}
|
Additional reference words: 4.00 4.01 4.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |