title: C error: "conflicting types for"
body: <p>My program includes the following code:</p>
  
  <pre><code>static short index(key)
   unsigned char *key;
  {
      long i, sum = 0;
      for (i = 0; key[i]; i++)
          sum += key[i];
      return(sum % TABLE_SIZE);
  }
  </code></pre>
  
  <p>But, it gives following error:</p>
  
  <pre><code>table.c:46:14: error: conflicting types for 'index'
   static short index(key)
                ^
  </code></pre>
  
  <p>I'm a C newbie, read about prototyping etc., but I cannot solve the problem.</p>