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

ID: Q115525


The information in this article applies to:


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 query words: 1.00 1.50 7.00 8.00 8.00c


Keywords          : kb16bitonly 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: July 27, 1999