When you name your source files *.c, MSVC (2010) assumes it's compiling C, which means C89. All block-local variables need to be declared at the beginning of your functions.
Or at begginning of {} block.