title: Implicit declaration of function ‘strdup’ (string.h included)
body: <p>I am trying to solve this warning for some while but I really don't know how is something like that possible.</p>
  
  <p>gcc command:</p>
  
  <pre><code>gcc -std=c99 -Wall -Wextra -pedantic -O0   -c -o myString.o myString.c
  </code></pre>
  
  <blockquote>
    <p>myString.c: In function ‘string_toCharArr’: myString.c:47:2: warning: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]<br>
    return strdup(s->data);</p>
  </blockquote>
  
  <p>File myString.h</p>
  
  <pre><code>#ifndef INCL_MYSTRING_H
  #define INCL_MYSTRING_H
  
  #include &lt;stdbool.h&gt;
  
  typedef struct sString{
      unsigned len;
      unsigned actLen;
      char *data;
  } string;
  
  
  string *new_string();
  
  bool string_append(string *s, char c);
  
  char *string_toCharArr(string *s);
  
  void string_clear(string *s);
  
  void string_destroy(string *s);
  
  #endif /* INCL_MYSTRING_H */
  </code></pre>
  
  <p>File myString.c</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  #include "myString.h"
  
  string *new_string(){
      //
  }
  
  bool string_append(string *s, char c){
      //
  }
  
  char *string_toCharArr(string *s){
      return strdup(s-&gt;data);
  }
  
  unsigned string_getLength(string *s){ 
      //
  }
  
  void string_clear(string *s){
      //
  }
  
  void string_destroy(string *s){
      //
  }
  </code></pre>
  
  <p>The same happens with <strong>fileno()</strong> and <strong>readlink()</strong> with <strong>unistd.h</strong> included.</p>
  
  <p><em>gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4</em></p>
  
  <p>Thanks!</p>