Share via


Aviso C26471

Não use reinterpret_cast. Um cast de void* pode usar static_cast (type.1)

Comentários

Nome da análise de código: NO_REINTERPRET_CAST_FROM_VOID_PTR

Exemplo

void function(void* pValue)
{
    {
        int* pointerToInt = reinterpret_cast<int*>(pValue); // C26471, use static_cast instead
    }
    {
        int* pointerToInt = static_cast<int*>(pValue); // Good
    }
}

Confira também

Diretrizes Principais do C++ Type.1