Compiler Error C2480
'identifier' : 'thread' is only valid for data items of static extent
You cannot use the thread
attribute with an automatic variable, nonstatic data member, function parameter, or on function declarations or definitions.
Use the thread
attribute for global variables, static data members, and local static variables only.
The following sample generates C2480:
// C2480.cpp
// compile with: /c
__declspec( thread ) void func(); // C2480
__declspec( thread ) static int i; // OK
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for