🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #816

Re: Common malloc/free practice violates ANSI standard ?

#816
From: Wm E Davidsen Jr
Date: Mon, 23 Oct 1989 14:51
16 lines
1368 bytes
In article <1989Oct19.101306.16791@twwells.com>, bill@twwells.com (T. William Wells) writes:
|  The standard requires that casting from (void*) to (OBJ*) and back
|  give pointers that compare equal and point to the same object.
|  Free will have no problems with it.

  I think you said this backward (or you misread it). You can cast *to*
a void pointer and *back* without loss of information, but not the
other way 'round. On machines which require allignment at all,
assignment to a pointer to an alligned type may result in loss of
information via rounding.

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon
Technical Details
Message-ID: <1328@crdos1.crd.ge.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!rpi!crdgw1!crdos1!davidsen
References: <1989Oct14.043811.669@anucsd.oz> <1989Oct19.101306.16791@twwells.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!rpi!crdgw1!crdos1!davidsen
From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: Common malloc/free practice violates ANSI standard ?
Message-ID: <1328@crdos1.crd.ge.COM>
Date: 23 Oct 89 14:51:05 GMT
References: <1989Oct14.043811.669@anucsd.oz> <1989Oct19.101306.16791@twwells.com>
Reply-To: davidsen@crdos1.UUCP (bill davidsen)
Followup-To: comp.std.c
Organization: GE Corp R&D Center
Lines: 16