Compiler Warning (level 4) C4296
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Warning (level 4) C4296

Error Message

'operator' : expression is always false

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

This warning is off by default. See Compiler Warnings That Are Off by Default for more information.

The following sample generates C4296:

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