Rules and Limitations for Using Naked Functions
Microsoft Specific —>
-
The return statement is not permitted in a naked function. However, you can return an int by moving the return value into the EAX register before the RET instruction.
-
Structured exception handling constructs are not permitted in a naked function, because the constructs must unwind across the stack frame.
-
The setjmp run-time function is not permitted in a naked function, because it too must unwind across the stack frame. However, the longjmp run-time function is permitted.
-
The _alloca function is not permitted in a naked function.
-
To ensure that no initialization code for local variables appears before the prolog sequence, initialized local variables are not permitted at function scope.
-
Frame pointer optimization (the /Oy compiler option) is not recommended, but it is automatically suppressed for a naked function.
END Microsoft Specific