Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.std.c Subject: Re: Common malloc/free practice violates ANSI standard ? Message-ID: <1152@crdos1.crd.ge.COM> Date: 16 Oct 89 19:51:33 GMT References: <1989Oct14.043811.669@anucsd.oz> <7366@thor.acc.stolaf.edu> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 22 In article <7366@thor.acc.stolaf.edu>, mike@thor.acc.stolaf.edu (Mike Haertel) writes: | In article <1989Oct14.043811.669@anucsd.oz> bdm@anucsd.oz (Brendan McKay) writes: | >* assigning a void* to an OBJ* involves rounding up to an even address | | The standard doesn't say anything about "rounding" pointers. [ exactly so, it doesn't say *anything* about it ] | Assigning a misaligned void* to an OBJ* might well cause a trap when | the OBJ* is dereferenced. Or even when the void* is just assigned to it! You're right, of course, but the standard doesn't forbid performing an allignment on a pointer assign, does it? I don't have a copy here, but I think we discussed this when someone said the standard *required* alligning the pointer. Just because no sane person would do something doesn't mean it's forbidden. -- 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