title: 'comparison is always true due to limited range of data type' warning in C?
body: <p>I have the following code </p>
  
  <pre><code>//Point.h
  #define WIDTH 8
  #define HEIGHT 8
  
  typedef struct Point
  {
    char x;
    char y;
  } Point;
  
  //Board.c
  #include &lt;stdbool.h&gt;
  
  // Some other functions that we don't care about... 
  
  bool inBounds(Point * p)
  {
    return p-&gt;x &gt;= 0
      &amp;&amp; p-&gt;x &lt;= WIDTH
      &amp;&amp; p-&gt;y &gt;= 0
      &amp;&amp; p-&gt;y &lt;= HEIGHT;
  }
  </code></pre>
  
  <p>When I compile this (ppu-gcc 4.1.1), I get the following warning</p>
  
  <pre><code>warning: comparison is always true due to limited range of data type
  </code></pre>
  
  <p>even though the range of char is -127 to 127 and WIDTH is 8, which is well inside the range of a char. I've already tried an explicit cast of WIDTH to a char, but still got the error.</p>