title: Two questions regarding static keyword in C
body: <p>I have this snippet of code:</p>
  
  <pre><code>int foo1(void); //line a
  
  int foo2(void) {
      return foo1();
  }
  
  int foo1(void) { //line b
      return 99;
  }
  </code></pre>
  
  <p>If I want to declare function foo1 to be static, should I put the keyword static in line a or line b? Is there any difference?</p>
  
  <p>Also say I have the following code in ANOTHER file that uses foo1 in the above file:</p>
  
  <pre><code>static int foo1(void);
  
  int main(void) {
      return foo1();
  }
  </code></pre>
  
  <p>The code still compiles and works as expected although I put static in the declaration line. But it gives a warning saying that 'foo1' used but never defined - if it's not defined, why does the code still work?</p>
  
  <p>Edit:
  Sorry I didn't make that clear, for the second question, foo1 in the first file where it's defined is not declared as static, but I declare it as static in the second file.</p>