BUG: C1001: Internal Compiler Error, msc1.cpp Using /Zi

Last reviewed: July 22, 1997
Article ID: Q115525
7.00 | 1.00 1.50 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 and 1.5
    

SYMPTOMS

Using a typedef function pointer as a parameter to another function, as shown in the example below, may cause the compiler to generate the following error when the code is compiled using the /Zi option:

      bug.c(13) : fatal error C1001: internal compiler error
                  (compiler file 'msc1.cpp', line 581)

The same code, compiled without the /Zi option, does not generate this error.

RESOLUTION

The functions in the example below pass a user-defined function pointer. When the user-defined data type in the function parameter is replaced with the actual data type (in other words, do not use typedefs), the code compiles correctly.

Also, in the case of the example below, reversing the order of the two function definitions also makes the code compile correctly.

STATUS

Microsoft has confirmed this to be a bug with the Microsoft products listed above. We are researching the problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following sample code can be used to demonstrate the problem:

Sample Code

/* Compile options needed: /c
*/

      typedef void _far _pascal MonIsrFnTy(void);

/* Replacing the current Function1 definition with:           */
/* static void _near Function1(void (_far _pascal             */
/*                             _far * _far * IsrPPFn)(void))  */
/* will fix this problem.  The same must be done with         */
/* the definition for Function2                               */

      static void _near Function1(MonIsrFnTy _far * _far * IsrPPFn)
      {
      }

      static void _near Function2(const MonIsrFnTy _far * IsrPFn)
      {
      }


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