My C language teacher claims that all variables must be defined before any operation. I can somehow recall it's a very old feature of C (no later than 1990) but I can't reproduce it with GCC 7.2.0.
My teacher claims this:
int main(){
int a; /* Valid */
a = 1; /* An operation */
int b; /* Invalid because an operation has already occurred */
return 0;
}
I tried compiling with
gcc test.c -std=c89 -Wall -Wextra -pedantic
but it gives no error, not even a warning.
How can I verify (or prove wrong) that statement?