BUG: Invalid "Argument List Doesn't Match A Function" Error

Last reviewed: July 22, 1997
Article ID: Q117146
4.00 4.01 4.10 | 4.00 4.01 4.10
MS-DOS         | WINDOWS
kbtool kbbuglist

The information in this article applies to:

  • Microsoft CodeView for MS-DOS, versions 4.0, 4.01, and 4.1
  • Microsoft CodeView for Windows, versions 4.0, 4.01, and 4.1

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:

  1. Build a debug version of the sample code.

  2. Start a debugging session using Codeview, and run to the following statement:

    e = f( d );

  3. 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 );
}


Additional reference words:
KBCategory: kbtool kbbuglist
KBSubcategory: CvwIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.