Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 776 Bytes

c26471.md

File metadata and controls

32 lines (25 loc) · 776 Bytes
title ms.date f1_keywords helpviewer_keywords description
Warning C26471
03/22/2018
C26471
NO_REINTERPRET_CAST_FROM_VOID_PTR
C26471
CppCoreCheck rule C26471 that enforces C++ Core Guidelines Type.1

Warning C26471

Don't use reinterpret_cast. A cast from void* can use static_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

C++ Core Guidelines Type.1