This documentation is archived and is not being maintained.

Compiler Error C2489

Error Message

'identifier' : initialized auto or register variable not allowed at function scope in 'naked' function

For more information, see naked (C++).

The following sample generates C2489:

// C2489.cpp
// processor: x86
__declspec( naked ) int func() {
   int i = 1;   // C2489
   register int j = 1;   // C2489