title: is there any way to find memory errors at the time of compilation in c
body: <p>Suppose in my Code i use something like this </p>
  
  <pre><code>int iLen = 0;
      char *sTmpStr;
  
  strcpy(sTmpStr, "abc");
  </code></pre>
  
  <p>now i have not alloted any address to pointer. so is there any option in gcc that will show this fault.</p>
  
  <p>i Tried optimisation but it does not gave this error.</p>
  
  <p>i tried -fsanitize=address but it gave error at the run-time something like this</p>
  
  <p>==1982== ERROR: AddressSanitizer: SEGV on unknown address 0x000000c38299 (pc 0x7f78d7b685b0 sp 0x7ffd8918a0b0 bp 0x7f78d7d7a668 T0)</p>
  
  <p>or is there any way i can write this o/p to a file</p>