Compiler Error C2489
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C2489.
identifier' : initialized auto or register variable not allowed at function scope in 'naked' function
For more information, see naked.
The following sample generates C2489:
// C2489.cpp
// processor: x86
__declspec( naked ) int func() {
int i = 1; // C2489
register int j = 1; // C2489
}
Show: