title: Signed/unsigned comparisons
body: <p>I'm trying to understand why the following code doesn't issue a warning at the indicated place.</p>
  
  <pre><code>//from limits.h
  #define UINT_MAX 0xffffffff /* maximum unsigned int value */
  #define INT_MAX  2147483647 /* maximum (signed) int value */
              /* = 0x7fffffff */
  
  int a = INT_MAX;
  //_int64 a = INT_MAX; // makes all warnings go away
  unsigned int b = UINT_MAX;
  bool c = false;
  
  if(a &lt; b) // warning C4018: '&lt;' : signed/unsigned mismatch
      c = true;
  if(a &gt; b) // warning C4018: '&lt;' : signed/unsigned mismatch
      c = true;
  if(a &lt;= b) // warning C4018: '&lt;' : signed/unsigned mismatch
      c = true;
  if(a &gt;= b) // warning C4018: '&lt;' : signed/unsigned mismatch
      c = true;
  if(a == b) // no warning &lt;--- warning expected here
      c = true;
  if(((unsigned int)a) == b) // no warning (as expected)
      c = true;
  if(a == ((int)b)) // no warning (as expected)
      c = true;
  </code></pre>
  
  <p>I thought it was to do with background promotion, but the last two seem to say otherwise.</p>
  
  <p>To my mind, the first <code>==</code> comparison is just as much a signed/unsigned mismatch as the others?</p>