Walter said:
I don't use gcc, and you are presuming an awful lot about the properties
of the compilers that I do use.
So you don't use gcc and your compiler doesn't have a warning about
missing declarations (I doubt it), fine. You don't want the cast.
Did I tell *you* should cast?
Thing is that bunch of people jumped onto Ryan Ply saying he
does a bad thing and everything, though it wasn't the case. Those
people (including you apparently, because I didnt' say anything
about your compiler and you're saying I am presuming something
about it) did not read what Ryan actually said. And then they
magically translated "I do it this way" into "You all shall do
it this way".
I am not saying "you should cast". I am saying "Ryan Ply is fine
because he knows what he is doing and he is doing a right thing". The
"don't cast result of malloc" is a good rule of thumb in general. But
there are situations (like this one) when cast is harmless, and might
be actually needed. Maybe one wants to compile it with C++ compiler,
or he likes the cast, the cast is valid and correct. And, it
does *not* suppress the warning about the *real* problem, the
problem of not including needed header.
There is no requirement that an implementation produce a diagnostic
for a missing prototype.
I didn't say there is such a requirement. Did I or someone else say it?
The problem is that Ryan said one thing ("works fine for me because
I make it so explicitely") and you all treated him like an fool which
doesn't read the FAQ or something.
Yevgen