title: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
body: <p>I have this c file </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(int argc, char *argv[])
  {
    int x,i,sum;
    sum = 0;
    FILE *fin;
    fin = fopen("testdata1", "r");
  
  
      for (i = 0; i &lt; 20; i++ ){
        fscanf(fin, "%d", &amp;x);
        sum += x;
      }
  
      printf("Sum = %d", sum);
      fclose(fin);
      return 0;
  
  
  }
  </code></pre>
  
  <p>I compiled it via <code>gcc -ansi -pedantic -Wall app.c -o app</code></p>
  
  <p>While compiling, I kept getting this <strong>warning error</strong></p>
  
  <blockquote>
    <p>warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
      FILE *fin;
            ^
    1 warning generated.</p>
  </blockquote>
  
  <p>Any hints on how do I stop that ? </p>