title: GCC Warning: implicit declaration of function 'puts' is invalid in C99
body: <p>I am beginning Zed Shaw's <a href="http://c.learncodethehardway.org/book/" rel="noreferrer">Learn C The Hard Way</a>.  I have downloaded XCode and the Command Line Tools.  But when I compile the very first program:</p>
  
  <pre><code>int main(int argc, char *argv[]) {
       puts("Hello world."); 
       return 0;
   }
  </code></pre>
  
  <p>I get this warning:</p>
  
  <blockquote>
    <p>ex1.c:2:1: warning: implicit declaration of function 'puts' is invalid
    in C99
          [-Wimplicit-function-declaration]</p>
  </blockquote>
  
  <p>The program does compile and execute correctly.</p>
  
  <p>I'm using OSX 10.8.3. Entering <code>'gcc -v'</code> gives:</p>
  
  <blockquote>
    <p>Using built-in specs. Target: i686-apple-darwin11 Configured with:
    /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure
    --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local
    --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)</p>
  </blockquote>
  
  <p>Please help.</p>