Mail Archives: djgpp/1997/03/04/10:37:45
Paul Derbyshire wrote:
>
> Why the HELL do people keep writing things like (char *)malloc(x)????????
>
> GCC, and to my knowledge other compilers, allow any pointer to be assigned
> to a variable of type void * and conversely allow any variable of type void
> * to be assigned to any pointer, without casts.
>
> --
> .*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
> -() < When I go to the theater, I always go straight to the "bag and mix"
> `*' bulk candy section...because variety is the spice of life... [me]
> Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
If you don't, and compile with -Wall (which everyone should) then you
get warnings about conversion without a cast. I know it happens with gcc
on
other platforms, and I think it happens on DOS too. (It still works, but
I don't like having warnings...)
Brian
- Raw text -