PRB: C1004 or C1060 Error Generated by Inline _asm Call

Last reviewed: October 3, 1997
Article ID: Q149615
The information in this article applies to:
  • The Microsoft C/C++ Compiler (CL.EXE) included with: - Microsoft Visual C++, 32-bit Edition, versions 2.0, 2.1, 2.2, 4.0,

         4.1, 5.0 on the following platform:
         - x86
    

SYMPTOMS

A C1004 (Unexpected End of File) or C1060 (Compiler is out of heap space) error may occur when comments are misused within inline assembly code.

STATUS

This behavior is by design.

MORE INFORMATION

Semicolons are used in assembly code to begin source comments. They behave exactly the same way as using the C++ comment specifier (//). All text following a semicolon is considered to be a comment. Comments terminate at the end of the current line.

Sample Code

   void main(void)
   {
      _asm { int 3; }    // The closing curly brace is ignored because it's
                         // part of the assembly comment line

      _asm {             // This code works because no valid code follows
         int 3;          // the semicolon comment specifier
      }

      _asm { int 3 }     // This also works and is valid code
   }


Additional query words: 9.00 9.10 9.20 10.00 10.10
Keywords : CLIss InLineAsmIss kbtshoot
Version : WINNT:2.0,2.1,2.2,4.0,4.1,5.0;
Platform : NT WINDOWS
Hardware : x86
Issue type : kbprb


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