Auf Englisch lesen

Freigeben über


Warnung C26471

Nicht reinterpret_cast verwenden. Eine Umwandlung von void* kann verwendet werden static_cast (type.1)

Hinweise

Name der Codeanalyse: NO_REINTERPRET_CAST_FROM_VOID_PTR

Beispiel

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

Siehe auch

C++ Core Guidelines Type.1