BUG: Trigraph Statements May Produce End-of-File Error

Last reviewed: March 13, 1998
Article ID: Q120668
The information in this article applies to:
  • Microsoft C/C++ Compiler (CL.exe) included with:

        - Visual C++ for Windows, versions 1.0, 1.5
        - Visual C++, 32-bit Edition, versions 1.0, 2.0, 4.1, 4.2, 5.0
    

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 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.

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


Additional query words: 1.00 1.50 2.00 8.00 8.00c 9.00 5.00
Keywords : CLIss
Version : MS-DOS:1.0,1.5; WINNT:1.0,2.0,4.1,4.2,5.0
Platform : MS-DOS winnt
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: March 13, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.