FIX: C1001: Extern in Function Call or Bad Type in Prototype

Last reviewed: September 19, 1997
Article ID: Q152131
The information in this article applies to:
  • The Microsoft C/C++ Compiler (CL.EXE) included with: - Microsoft Visual C++, 32-bit Edition, versions 4.0, 4.1, 4.2

SYMPTOMS

When using extern in a function call, the compiler generates an Internal Compiler Error (ICE). A syntax error should be generated instead.

When specifying an illegal type in a function prototype within a function, the compiler generates an ICE. A syntax error should be generated instead.

Both of the above situations result in the following error message when using Visual C++ 4.0:

   fatal error C1001: INTERNAL COMPILER ERROR
   (compiler file 'msc1.cpp', line 899)

When using Visual C++ 4.1, the error message in both situations is the following:

   fatal error C1001: INTERNAL COMPILER ERROR
   (compiler file 'msc1.cpp', line 1090)

When using Visual C++ 4.2, the error message in both situations is the following:

   fatal error C1001: INTERNAL COMPILER ERROR
   (compiler file 'msc1.cpp', line 1089)

RESOLUTION

Do not use extern in a function call.

Specify a legal type in the argument list of the function prototype.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ version 5.0.

MORE INFORMATION

Sample Code

   /* Compile options needed: none
   */

   //Code sample 1
   int func(int);

   void main () {
      extern func(1);   //C1001 (ICE) on this line; "extern" is illegal
   }

   //Code sample 2
   int func(int);

   void main () {
      extern int func(1);  //C1001 (ICE); "1" is an illegal type
   }
Keywords          : CPPIss vcbuglist400 vcfixlist500 kbprg
Version           : 4.0 4.1 4.2
Platform          : NT WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


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: September 19, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.