title: Compiling errors using clang for if conditions
body: <p>So, I wrote down this code where the main goal is to retrieve JPEGs from a memory card.</p>
  <p>This is what I wrote until now. However, when compiling, it gives me errors on the conditions.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char *argv[])
  {
      //Check for only the presence of 1 input to run
      if (argc != 2)
      {
          printf(&quot;Usage of only 1 command line argument&quot;);
          return 1;
      }
      //Name of the file storage in &quot;name&quot;
      char *name = argv[1];
      //As we know is 512B, give that specific syze
      char block[512];
      //Open file
      FILE *original = fopen (name, &quot;r&quot;);
      //check if it has anything in it
      if (original == NULL)
      {
          printf (&quot;The file has nothing on it\n&quot;);
          return 1;
      }
      //Variables to work with
      FILE *copia;
      char jpeg[8];
      int count = 0;
      //while reading its content
      while (fread (block, 512, 1, original) == 1)
      {
          //condition for the beggining of the jpeg
          if (block[0] == 0xff &amp;&amp; block[1] == 0xd8 &amp;&amp; block[2]==0xff &amp;&amp; (block[3] &amp; 0xf0) == 0xe0)
          {
              //Case of the first jpeg
              if (count == 0)
              {
                  sprintf (jpeg, &quot;%03i.jpg&quot;, count);
                  copia = fopen (jpeg, &quot;w&quot;);
                  fwrite (block, 512, 1, copia);
                  count = count + 1;
                  fclose (copia);
              }
              //Case for over
              if (count &gt; 0)
              {
                  sprintf (jpeg, &quot;%03i.jpeg&quot;, count);
                  count = count +1;
                  copia = fopen (jpeg, &quot;w&quot;);
                  fwrite (block, 512, 1, copia);
                  fclose(copia);
              }
          }
          //close file
          fclose(original);
          return 0;
      }
  }
  </code></pre>
  <p>Compiler messages:</p>
  <pre class="lang-none prettyprint-override"><code>clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow    recover.c  -lcrypt -lcs50 -lm -o recover
  recover.c:32:22: error: result of comparison of constant 255 with expression of type 'char' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
          if (block[0] == 0xff &amp;&amp; block[1] == 0xd8 &amp;&amp; block[2]==0xff &amp;&amp; (block[3] &amp; 0xf0) == 0xe0)
              ~~~~~~~~ ^  ~~~~
  
  
  recover.c:32:42: error: result of comparison of constant 216 with expression of type 'char' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
          if (block[0] == 0xff &amp;&amp; block[1] == 0xd8 &amp;&amp; block[2]==0xff &amp;&amp; (block[3] &amp; 0xf0) == 0xe0)
                                  ~~~~~~~~ ^  ~~~~
  
  
  
  recover.c:32:61: error: result of comparison of constant 255 with expression of type 'char' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
          if (block[0] == 0xff &amp;&amp; block[1] == 0xd8 &amp;&amp; block[2]==0xff &amp;&amp; (block[3] &amp; 0xf0) == 0xe0)
                                                      ~~~~~~~~^ ~~~~
  3 errors generated.
  &lt;builtin&gt;: recipe for target 'recover' failed
  make: *** [recover] Error 1
  </code></pre>
  <p>Can anyone shed some light on this subject?</p>