casting void pointers

Stephen R. van den Berg berg at marvin.e17.physik.tu-muenchen.de
Tue Apr 23 19:47:18 AEST 1991


Roger A. Hurwitz writes:
>Even K&R 2d states that an explicit cast should be used with malloc(),
>in another part of the book (p. 142), but I am having trouble reconciling
>that with the above language.

malloc does not need the cast, any compiler complaining about that is
braindamaged (or not ANSI compliant :-)
--
Sincerely,                 berg at marvin.e17.physik.tu-muenchen.de
           Stephen R. van den Berg.
"I code it in 5 min, optimize it in 90 min, because it's so well optimized:
it runs in only 5 min.  Actually, most of the time I optimize programs."



More information about the Comp.lang.c mailing list