🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #836

Re: Common malloc/free practice violates ANSI standard ?

#836
From: Alan J Rosenthal
Date: Tue, 24 Oct 1989 15:27
15 lines
1057 bytes
davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) writes:
>You can cast *to* a void pointer and *back* without loss of information, but
>not the other way 'round.

This is fine, but why can't we just say that the return value from malloc()
represents a pointer which can be assumed to have been casted to (void *) from
whatever type you like?  This is another way to say the "suitably aligned" rap.

(Flame retardant:  I'm not claiming that the draft does in fact say it in this
way, just claiming that this is a good way to think of it.)

ajr

--
Vs encr vf n xvaq bs frk, gura n chapu va gur zbhgu vf n xvaq bs gnyxvat.
Technical Details
Message-ID: <1989Oct24.112715.19918@jarvis.csri.toronto.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps
References: <1989Oct14.043811.669@anucsd.oz> <1989Oct19.101306.16791@twwells.com> <1328@crdos1.crd.ge.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps
From: flaps@dgp.toronto.edu (Alan J Rosenthal)
Newsgroups: comp.std.c
Subject: Re: Common malloc/free practice violates ANSI standard ?
Message-ID: <1989Oct24.112715.19918@jarvis.csri.toronto.edu>
Date: 24 Oct 89 15:27:15 GMT
References: <1989Oct14.043811.669@anucsd.oz> <1989Oct19.101306.16791@twwells.com> <1328@crdos1.crd.ge.COM>
Lines: 15