delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/04/08:38:56

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: <B0000041587 AT datasoft DOT datasoft DOT com DOT br> <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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019