BUG: Compiler Incorrectly Decorates C++ Operators

Last reviewed: July 22, 1997
Article ID: Q116169
7.00 | 1.00 1.50 1.51 1.52 MS-DOS | WINDOWS kbtool kbbuglist

The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE), included with:

        - Microsoft C/C++ for MS-DOS, version 7.0
        - Microsoft Visual C++ for Windows, versions 1.0, 1.5, 1.51 and
          1.52
    

SYMPTOMS

The Microsoft C++ Compiler for MS-DOS, versions 8.0 and 8.0c, gives class operators incorrect function signatures. This does not cause compiler or linker errors to be generated, but it does, however, cause problems when you try to debug the application. Specifically, CodeView is unable to find the function by means of the Label/Function option on the Search menu.

STATUS

Microsoft has confirmed this to be a bug with 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

To view this problem, use the following steps:

  1. Type in the sample code shown below.

  2. After compiling the application, start CodeView to debug the application.

  3. In CodeView, choose the Label/Function option from the Search menu.

  4. Type in "testclass::int" (without the quotes) and press Return. CodeView will display a dialog box saying "unknown symbol".

NOTE: This problem does not prevent the application from functioning properly.

Sample Code

/* Compile options needed: /Zi /Od
*/
   #include <stdio.h>

   struct testclass
   {
      int i;
      operator int() { return i; };
   };

   void test(int i)
   {
      printf("%d\n",i);
   }

   void main()
   {
      testclass f;
      f.i = 13;
      test(f);
   }


Additional reference words: 1.00 1.50 7.00 8.00 8.00c
KBCategory: kbtool kbbuglist
KBSubcategory: CPPIss
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.