Article ID: 139028 - Last Review: July 5, 2005 - Revision: 1.1

FIX: Incomplete pragma Directive May Cause C1001 Error

This article was previously published under Q139028

On This Page

Expand all | Collapse all

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

This bug was corrected in Microsoft Visual C++, version 6.0.

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")
				

APPLIES TO
  • Microsoft Visual C++ 4.0 Standard Edition
  • Microsoft Visual C++ 4.1 Subscription
  • Microsoft Visual C++ 4.2 Enterprise Edition
  • Microsoft Visual C++ 4.2 Professional Edition
  • Microsoft Visual C++ 5.0 Enterprise Edition
  • Microsoft Visual C++ 5.0 Professional Edition
Keywords: 
kbbug kbfix kbvc600fix KB139028
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations