title: make ignores -std=c99 flag when compiling and linking a C program
body: <p>I've tried to get my makefile to compile a file that requires <code>-std=c99</code> to run. In this case, its to get a "for-loop" through. </p>
  
  <p>This is my code, (its been used "tab" before "$(CC)" ):</p>
  
  <pre><code>CC = gcc
  CFLAGS = -c -std=c99
  
  ...
  
  Download.o : Download.c
      $(CC) $(CFLAGS) Download.c
  </code></pre>
  
  <p>Download.c contains methods used to download elements from the web</p>
  
  <h3>Error message</h3>
  
  <pre><code>$ make
  gcc -c -std=c99 Download.c
  gcc Download.c -o Program
  Download.c: In function ‘downloadImageparts’:
  Download.c:11:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  Download.c:11:2: note: use option -std=c99 or -std=gnu99 to compile your code
  Download.c:13:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
  make: *** [comp] Error 1
  </code></pre>
  
  <h3>Attemt to debug</h3>
  
  <p>If I run <code>gcc -c -std=c99 Download.c</code> in terminal it works fine.</p>
  
  <p>This problems appears when run in Linux.</p>
  
  <p><strong>SOLVED:</strong></p>
  
  <p>I created a dummy project to show my lecturer, in an attempt to solve my problem. In the dummy project all works fine with the code described. For some reason my code works on place but not in the other. If someone reading this having the same problem as me and would like to see an example project. let me know and I'll write the code here. Thanks</p>