From: Thomas Knudsen Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP structs Date: Wed, 5 Mar 1997 12:21:03 +0100 Organization: News Server at UNI-C, Danish Computing Centre for Research and Education. Lines: 42 Message-ID: References: <5fiu3p$bne AT freenet-news DOT carleton DOT ca> <5fjfrp$b5v AT news DOT ox DOT ac DOT uk> NNTP-Posting-Host: geb.gfy.ku.dk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <5fjfrp$b5v@news.ox.ac.uk> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 5 Mar 1997, George Foot wrote: > Paul Derbyshire (ao950 AT FreeNet DOT Carleton DOT CA) wrote: > > > : I have never explicitly cast a malloc pointer when assigning it. Even with > : my usual -Wall -Werror it never causes any complaint from gcc. > > : Are you sure this is non-ansi? > > : mypointer=malloc(size); > > I'm not sure what the standard says for C programs, but for C++ programs it > is definitely not allowed - try it. I was under the impression that ANSI C > was basically ANSI C++ without classes; clearly I'm wrong. > > -- > George Foot > Merton College, Oxford. > > ... perhaps you should remember that C++ is a *strongly* typed language - C is not, so Paul's assigning of a void pointer to a whatever-pointer is actually allowed, as long as the compiler has a chance to know how to convert void * to whatever *. In other words: C != (C++)-- ;-) Thomas -- Thomas Knudsen | www: http://www.gfy.ku.dk/~tk/ National Survey and Cadastre - Denmark | e-mail: tk AT gfy DOT ku DOT dk Geodetic office, Rentemestervej 8 | Direct Phone: +45 35 87 52 55 DK-2400 Copenhagen NV, Denmark | FAX: +45 35 87 50 52