I'm implementing some basic data structures in C and I found out that if I omit the return type from a function and call that function the compiler doesn't generate an error. I compiled with cc file.c
and didn't use -Wall
(so I missed the warning) but in other programming languages this is a serious error and the program won't compile.
Per Graham Borland's request, here's a simple example:
int test()
{
printf("Hi!");
}
int main()
{
test();
}