Compiler Warning (level 2) C4308
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Warning (level 2) C4308.
negative integral constant converted to unsigned type
An expression converts a negative integer constant to an unsigned type. The result of the expression is probably meaningless.
// C4308.cpp
// compile with: /W2
unsigned int u = (-5 + 3U); // C4308
int main()
{
}
Show: