delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/06/04:50:00

From: Thomas Knudsen <tk AT geb DOT gfy DOT ku DOT dk>
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: <Pine.SGI.3.95.970305121415.4861A-100000@geb.gfy.ku.dk>
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
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 <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
> 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



- Raw text -


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