Prior to the C99 standard, all announcements should have appeared before any statements in the block:
void foo() { int i, j; double k; char *c;
C99 is allowed to mix declarations and statements (e.g. C ++). Many compilers still use C89, and some compilers (like Microsoft) do not support C99 at all.
So, you will need to do the following:
Determine if your compiler supports C99 or later; if so, configure it so that it compiles C99 instead of C89;
If your compiler does not support C99 or later, you need to either find another compiler that supports it, or rewrite the code so that all declarations come before any statements inside the block.
John Bode Nov 08 '12 at 16:22 2012-11-08 16:22
source share