[PATCH] Add -Wdeclaration-after-statement to CFLAGS
gcc-4.1 seems to default to conforming to the C99 standard which allows declarations after statements, ie
void whatever (int param)
{
if (param == 0)
return ;
int a = 10 ;
return a ;
}
The above is reported as an error in compilers which conform to earlier C standards.
The problem is that anyone working with a C99 compiler can accidentally commit code that breaks the compile for some other compilers.
The solution (at least for C99) is to compile with the -Wdeclaration-after-statement CFLAG, but not all versions of gcc recognise that flag. Fortunately its possible to detect whether gcc accepts this CFLAG at configure time.