In C, you can actually compile code without declaring the function. The compiler will silently assume it to return an int, unless of course, you turned on warnings.
If the function doesn't return an int, this may be disastrous. Which is why in C it's recommended you don't cast malloc. If you forget stdlib.h, well, at runtime it definitely won't be working properly.
(Obviously, do not take my remarks as a sign that you should ever rely on the default assumption. Always declare the function before using it.)