Warning C26471
Don't use
reinterpret_cast
. A cast fromvoid*
can usestatic_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
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ