From: aho450s AT nic DOT smsu DOT edu (Tony O'Bryan) Newsgroups: comp.os.msdos.djgpp Subject: Re: quick malloc question Date: Tue, 04 Mar 1997 12:29:26 GMT Organization: Southwest Missouri State University Lines: 13 Message-ID: <331c14b7.763008@ursa.smsu.edu> References: <5fdn2o$mvl AT freenet-news DOT carleton DOT ca> <19970303 DOT 220414 DOT 8255 DOT 0 DOT chambersb AT juno DOT com> NNTP-Posting-Host: forseti.i59.smsu.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Tue, 4 Mar 1997 06:01:08 GMT, chambersb AT juno DOT com (Benjamin D Chambers) wrote: >It is my understanding that gcc complains when you do so. In fact, I >believe gcc complains when _anything_ is converted without a cast >(although I don't have time to verify - if anyone knows the answer, >please let me know if I'm wrong). I learned C with the understanding that typecasted conversions were good programming practice. In C, however, typecasting malloc is not necessary. ANSI C++ forbids implicit conversion of void pointers (according to the g++ error I got). GCC and Turbo C both allow implicit void conversions according to my brief tests with all warning messages enabled. In other words, neither Turbo C nor GCC complained about it in a .C program.