Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 696 Bytes

c26471.md

File metadata and controls

29 lines (24 loc) · 696 Bytes
title ms.date ms.topic f1_keywords helpviewer_keywords description
C26471
03/22/2018
reference
C26471
C26471
CppCoreCheck rule C26471 that enforces C++ Core Guidelines Type.1

C26471 NO_REINTERPRET_CAST_FROM_VOID_PTR

Don't use reinterpret_cast. A cast from void* can use static_cast.

See also

C++ Core Guidelines Type.1

Example

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