I read in the c99 Standard:
-remove implicit function declaration,
-remove implicit int.
But when I try to compile this code with gcc compiler in c99 mode using -pedantic
main(void){
f(3);
return 0;
}
int f(int a){
....
}
I expect 2 errors, but I just receive 2 warnings:
-warning: return type defaults to ‘int’
-warning: implicit declaration of function ‘f’.
Shouldn't them be errors in c99?
http://gcc.gnu.org/c99status.html In both situations there's written "done".
Thanks.
-pedanticjust means be pedantic in telling the user. If you want the compiler to stop compilation on encountering such things, use-pedantic-errors. However,-Werrormay be even better (in conjunction with-Wall -Wextra), since even warnings not required by the standard are undesirable.