Like many others, due to the fact that an error does not occur when there is no prototype for historical reasons. Previously, people often did not worry about prototyping functions, because pointers and integers were usually the same size, and integral types smaller than an integer were passed to an integer when passed as a parameter (and a floating point was rarely used for system programming).
If at some point they changed the compiler to give an error, if the function was not prototyped, then it would break many programs and would not be widely recognized.
With 64-bit addressing, we are now introducing a period when integers and pointers are not the same size, and programs are likely to break if you don't prototype functions like malloc () that return a pointer.
Gcc always sets the following options for your own programs: -Werror -Wstrict-prototypes
source share