title: How do I remove the following 'implicit declaration of function' warnings?
body: <p>How do I compile the lex file with gcc without receiving the following warnings?  </p>
  
  <pre><code>lex.yy.c: In function `yy_init_buffer':
  lex.yy.c:1688: warning: implicit declaration of function `fileno'
  lex.l: In function `storeLexeme':
  lex.l:134: warning: implicit declaration of function `strdup'
  </code></pre>
  
  <p>These are the libraries I included. </p>
  
  <pre><code>%{
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  #include &lt;string.h&gt;
  %}
  </code></pre>
  
  <p>The function yy_init_buffer is not in the file. The following is the function storeLexeme. </p>
  
  <pre><code> int storeLexeme() {
  for (int i = 0; i &lt; count; i++) {
      char *curr = *(symbolTable + i); 
      if (strcmp(curr, yytext) == 0) {
          return i;
      }
  }
  char *lexeme = (char *)malloc(sizeof(char *));
  lexeme = (char *)strdup(yytext);
  symbolTable[count] = lexeme;
  count++;
  return (count - 1);
   }
  </code></pre>
  
  <p>How do I remove the warnings? </p>