[ Imprimis, while snipping is good, snipping every single bit of context
is not. ]
Stroutstrup himself has said that all good-style C programs are also C++
programs,
Well, he's just wrong, then, isn't he? Or rather, he has what I would
consider silly opinions about what is good style in C; good style in C
does _not_ involve useless casts strewn through your code.
so it's just better style.
Let me get this right: someone who is an authority on C++ says something
about C, _so_ it is correct? Don't you think you trust big names a bit
too easily?
Also, we're not limited to malloc() here,
One more reason not to care what a C++ compiler does with C code.
Thirdly, it's always best to be explicit.
Wrong.
Or do you also write
(void) (int_a = (int) int_b);
and
for (i=(size_t)0;
(size_t)i<(size_t)NUMENTRIES;
i=(size_t)((size_t)i+(size_t)1))
if ((int)mung_array((int *)array, (size_t)i)!=(int)0)
break;
Lastly, it provides compatibility with older compilers.
Which, for the average user, is the only reason, and it is one that
should come up rarely, if ever.
OTOH, too many casts engender confusion in the programmer and insecurity
in the maintainer, so they are an abomination.
Richard