Why prototype and definition of a function in C may differ?

Viewed 496

I'm wondering why this will compile:

int test();

int main() { return test((void*)0x1234); }
int test(void* data) { return 0; }

Why won't the compiler emit any error/warning about that (I tried clang, gcc)? If I change the return value it won't compile - but the arguments may differ?!

2 Answers
Related