Compiler Warning (level 2) C4308
negative integral constant converted to unsigned type
Remarks
An expression converts a negative integer constant to an unsigned type. The result of the expression is probably meaningless.
The /sdl
(Enable Additional Security Checks) compiler option elevates this warning to an error.
Example
// C4308.cpp
// compile with: /W2
unsigned int u = (-5 + 3U); // C4308
int main()
{
}
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ