Bewerken

Delen via


Compiler Warning (level 4, off) C4296

'operator' : expression is always false

An unsigned variable was used in a comparison operation with zero.

This warning is off by default. For more information, see Compiler Warnings That Are Off by Default.

The following sample generates C4296:

// C4296.cpp
// compile with: /W4
#pragma warning(default : 4296)
int main()
{
   unsigned int u = 9;
   if (u < 0)    // C4296
      u++;
   if (u >= 0)   // C4296
      u++;
}