title: Why does compiler not give a warning in this case
body: <p>This piece of code :</p>
  
  <pre><code>       char buff[255];
         memcpy(buff,0,255);
  </code></pre>
  
  <p>The compiler doesn't give any warning during compilation but the process fails with a segmentation fault
  But when I compile the following code </p>
  
  <pre><code>       char buff[255];
         memcpy(buff,2,255);
  </code></pre>
  
  <p>The compiler gives the following warning </p>
  
  <blockquote>
    <p>warning: passing argument 2 of 'memcpy' makes pointer from integer without a cast [enabled by default]</p>
  </blockquote>
  
  <p>Why does compiler not give an warning for the constant 0
  I am using GCC version 4.7.2</p>
  
  <p>Also is there some compiler flag that will give warnings for such code</p>