不使用
reinterpret_cast。 来自void*的强制转换可使用static_cast(type.1)
备注
代码分析名称:NO_REINTERPRET_CAST_FROM_VOID_PTR
示例
void function(void* pValue)
{
{
int* pointerToInt = reinterpret_cast<int*>(pValue); // C26471, use static_cast instead
}
{
int* pointerToInt = static_cast<int*>(pValue); // Good
}
}