FIX: C1001 Error Compiling Naked Function with /Og and /G5Last reviewed: September 18, 1997Article ID: Q122302 |
2.00
WINDOWS NT
kbtool kbbuglist
The information in this article applies to:
SYMPTOMSCompiling a function with the __declspec(naked) modifier, but without an __asm block for the epilog code, and using the /Og and /G5 switches, results in the following error:
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'l:\b_bld\c2\P2\main.c', line 374) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information RESOLUTIONImplement a epilog code block in your function.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was fixed in Microsoft Visual C++, 32-bit Edition, version 4.0.
MORE INFORMATIONIf a function is declared with the __declspec(naked) modifier, the compiler will not generate any prolog or epilog code. Users should implement their own prolog and epilog code, using blocks of inline assembler code. NOTE: without proper prolog and epilog code, the code will not execute correctly.
Sample Code
/* Compile options needed: /Og /G5 Note that /O1, /O2, and /Ox all imply /Og */ void __declspec(naked) NakedFunction(){ __asm { // prolog code } printf( "Inside naked function\n" ); // note: epilog __asm block missing}
|
Additional reference words: 2.00 9.00 buglist2.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |