title: Warning C4013: undefined; assuming extern returning int
body: <p>I got another warning which is</p>
  
  <blockquote>
    <p>C4047: 'initializing' : 'char *' differs in levels of indirection from 'int'.</p>
  </blockquote>
  
  <p>Why do I get those warnings? I have read on MSDN that it generated if I wrote a different function name to that I wrote in the header file or it should be extern function.
  Could someone shed some light on it?</p>
  
  <p>My relevant code is:</p>
  
  <p><strong>GetSignature.c</strong></p>
  
  <pre><code>#include "Parse_Database.h"
  #include "Alloc_Mem.h"
  #include "Get_Signature.h"
  
  
  int Get_Signature(const char *filename) {
      char *database = AllocMem(filename);
      int error=0;
  
      //ParseDatabase(database);
  
      return 1;
  }
  </code></pre>
  
  <p><strong>AllocMem</strong></p>
  
  <pre><code>#include "Alloc_Mem.h"
  
  
  char *AllocMem(const char *filename)    {
      FILE *fp = NULL;
      int ch = EOF;
      char *buf = NULL, *tmp = NULL;
      unsigned int size=0, index=0;
  
      /*
          Mallicous use of fopen(anyone could replace filename with a malicous modified file)
      */
      fp = fopen(filename, "r");
      if(fp == NULL)  {
          fprintf(stderr, "Can't open the signature database");
          exit(1);
      }
  
      while(ch)   {
          fread(&amp;ch, 1, 1, fp);
  
          if(ch == EOF)   {
              ch = 0;
          }
  
          if(size &lt;= index)   {
              size+=chunk;
              tmp = realloc(buf, size);
              if(!tmp)    {
                  free(buf);
                  buf = NULL;
                  break;
              }
              buf = tmp;
          }
  
          buf[index++] = ch;
      }
  
      fclose(fp);
      return buf;
  }
  </code></pre>
  
  <p><strong>Alloc_Mem.h</strong></p>
  
  <pre><code>#ifndef HEADERFILE_H
  #define HEADERFILE_H
  
  #ifdef _MSC_VER
  #define _CRT_SECURE_NO_WARNINGS
  #endif
  
  #define chunk 255
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  char *AllocMem(const char *);
  
  #endif
  </code></pre>