BUG: Incomplete pragma Directive May Cause C1001 Error

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

SYMPTOMS

When you use an incomplete #pragma preprocessor directive, the following internal compiler error may be generated:

   warning C4081: expected '('; found 'newline'
   fatal error C1001: INTERNAL COMPILER ERROR
   (compiler file 'msc1.cpp', line 899)
   Please choose the Technical Support command on the Visual C++
   Help menu, or open the Technical Support help file for more
   information

While the code is not valid, the compiler should not generate an internal compiler error. However, the C4081 warning is valid.

RESOLUTION

Use a complete pragma directive. For a listing of valid pragma directives and their syntax, please consult the Help menu.

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 #pragma directives that cause this problem are:

  • alloc_text
  • auto_inline
  • code_seg
  • comment
  • data_seg
  • function
  • init_seg
  • inline_depth
  • inline_recursion
  • intrinsic
  • optimize
  • pack
  • pointers_to_members
  • setlocale
  • vtordisp
  • warning

Sample Code to Demonstrate Problem

   // Compile Options - none

   #pragma comment

   // the previous line is incomplete,
   // the following line is complete and won't cause the error:
   // #pragma comment(lib, "msvcrt.lib")


Additional query words: 10.00 10.10 10.20
Keywords : CLIss vcbuglist400 vcbuglist500
Version : 4.0 4.1 4.2 5.0
Platform : NT WINDOWS
Issue type : kbbug


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