Superfluous casting is dangerous because it hides potential errors.
Until now, there wasn’t much to happen though. But that changed with the introduction of 64 bit architectures.
The problem is that if you forget to include malloc() ’s include file (stdlib.h), the C compiler generates automatically a prototype whose return value is int, i.e. 32 bit. But on 64 bit architectures, pointers have 64 bit. So the upper 32 bit get truncated and then casted back to 64 bit, i.e. filled up with zeros.
That seemed to be not a problem most of the time. Now, FreeBSD changed its malloc() allocator and it returns regularly pointers regions above the 4 GB mark (i.e. needing more than 32 bit for addressing) in the process address space. Therefore returned addresses become altered and everything crashes with a big bang.
So remember, warnings are there to help you, not to get mindlessly casted away!
[via Ilja]
NB This doesn’t apply to C++. You have to cast there.