Article ID: 117146
Article Last Modified on 10/23/2003
APPLIES TO
- Microsoft CodeView 4.0
- Microsoft CodeView 4.01
- Microsoft CodeView 4.1
- Microsoft CodeView 4.0
- Microsoft CodeView 4.01
- Microsoft CodeView 4.1
This article was previously published under Q117146
SYMPTOMS
Evaluating a C++ function in the Codeview command window using the function's default parameter values will cause Codeview to give an error message stating that the "argument list doesn't match a function", even though default parameters have been specified in the code.
CAUSE
The Codeview expression evaluator was not designed to process default arguments for C++ functions. Therefore, it expects a C++ function to receive the exact number of parameters specified in the function's formal parameter list.
RESOLUTION
For Codeview to evaluate the function properly, you must include values for all of the function's parameters.
STATUS
Microsoft 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 INFORMATION
The sample code shown below can be used to demonstrate the problem. To see the problem, follow these steps:
- Build a debug version of the sample code.
- Start a debugging session using Codeview, and run to the following statement:
e = f( d );
- In the Codeview command window, enter the command ?f(3). This will cause the error message described above to be generated. However, entering the command ?f(3,10) will work since the expression evaluator expects f to receive two parameters.
Sample Code
/* Compile options needed: /Zi /Od /Tp */ int f( int a, int b = 0 ) { return (a + b); } void main( void ) { int d = 5, e; e = f( d ); }
Keywords: kb16bitonly KB117146