BUG: Trigraph Statements May Produce End-of-File Error (120668)



The information in this article applies to:

  • Microsoft Visual C++ for Windows, 16-bit edition 1.0
  • Microsoft Visual C++ for Windows, 16-bit edition 1.5
  • Microsoft Visual C++, 32-bit Editions 1.0
  • Microsoft Visual C++, 32-bit Editions 2.0
  • Microsoft Visual C++, 32-bit Editions 4.1
  • Microsoft Visual C++, 32-bit Editions 4.2
  • Microsoft Visual C++, 32-bit Editions 5.0
  • Microsoft Visual C++, 32-bit Editions 6.0
  • Microsoft Visual C++ .NET (2002)
  • Microsoft Visual C++ .NET (2003)

This article was previously published under Q120668

SYMPTOMS

Trigraphs are three-character sequences used to represent punctuation unavailable in a character set. When the compiler encounters Trigraph statements that use ifdef and endif statements, it gives the following erroneous end-of-file error:
fatal error C1004: unexpected end of file found.

CAUSE

Trigraph translation is not finished before processing, so the #endif (the equivalent of ??=endif) is not reached.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

NOTE: This problem did not occur in Microsoft Visual C++, 32-bit Edition, version 4.0.

MORE INFORMATION

The following is sample code to reproduce the problem:
   /* Compile options needed: none
   */ 

   ??=ifdef TESTING
   int i=0;
   ??=endif
				

Modification Type:MinorLast Reviewed:7/5/2005
Keywords:kbBug kbCompiler KB120668