naked

Microsoft Specific —>

__declspec( naked ) declarator

For functions declared with the naked attribute, the compiler generates code without prolog and epilog code. You can use this feature to write your own prolog/epilog code using inline assembler code. Naked functions are particularly useful in writing virtual device drivers.

Because the naked attribute is relevant only to the definition of a function and is not a type modifier, naked functions use the C++ Extended Storage-Class Attributes syntax.

For related information, see __declspec The naked Attribute Argument Passing and Naming Conventions Naked Function Calls.

Example

This code defines a function with the naked attribute:

// Example of the naked attribute
__declspec( naked ) int func( formal_parameters )
{
    // Function body
}

END Microsoft Specific