title: Why is the gets function so dangerous that it should not be used?
body: <p>When I try to compile C code that uses the <code>gets()</code> function with GCC, I get this warning: </p>
  
  <blockquote>
    <p>(.text+0x34): warning: the `gets' function is dangerous and should not be used.</p>
  </blockquote>
  
  <p>I remember this has something to do with stack protection and security, but I'm not sure exactly why.</p>
  
  <p>How can I remove this warning and why is there such a warning about using <code>gets()</code>? </p>
  
  <p>If <code>gets()</code> is so dangerous then why can't we remove it?</p>