Warning C26471
Don't use
reinterpret_cast
. A cast fromvoid*
can usestatic_cast
(type.1)
Remarks
Code analysis name: NO_REINTERPRET_CAST_FROM_VOID_PTR
Example
void function(void* pValue)
{
{
int* pointerToInt = reinterpret_cast<int*>(pValue); // C26471, use static_cast instead
}
{
int* pointerToInt = static_cast<int*>(pValue); // Good
}
}
See also
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