หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
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
The following example generates C4308:
// C4308.cpp
// compile with: /W2
unsigned int u = (-5 + 3U); // C4308
int main()
{
}