title: Can an ANSI C-compliant implementation include additional functions in its standard library?
body: <p>Is an ANSI C-compliant implementation allowed to include additional types and functions in its standard library, beyond those enumerated by the standard?  (An ideal answer would reference the relevant part of the ANSI standard.)</p>
  
  <p>I ask particularly because Mac OS 10.7 declares the <code>getline</code> function in stdio.h, even when compiling with gcc or clang using the <code>-ansi</code> flag.  This breaks several older programs that define their own <code>getline</code> function.  Is this a fault of Mac OS 10.7?  (The man page for <code>getline</code> on Mac OS 10.7 says that <code>getline</code> conforms to the POSIX.1 standard, which came in 2008.)</p>
  
  <p>Edit:  To clarify, I find it odd that including stdio.h in an ANSI C89 program on Mac OS 10.7 also pulls in the declaration for the <code>getline</code> function, since <code>getline</code> is not one of the functions enumerated in the K&amp;R (and presumably ANSI) description of stdio.h.  In particular, attempting to compile <a href="http://www.cs.tufts.edu/~nr/noweb/">noweb</a>:</p>
  
  <pre><code>gcc -ansi -pedantic    -c -o notangle.o notangle.c
  In file included from notangle.nw:28:
  getline.h:4: error: conflicting types for ‘getline’
  /usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
  </code></pre>
  
  <p>Is it a bug in Mac OS 10.7 includes the declaration of <code>getline</code> in stdio.h even when compiling for the ANSI C89 standard?</p>