Common malloc/free practice violates ANSI standard ?

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Tue Oct 17 05:46:32 AEST 1989


In article <1989Oct14.043811.669 at anucsd.oz>, bdm at anucsd.oz (Brendan McKay) writes:
|  [  elaborate and nifty argument here  ]
|  
|  Note that I'm not claiming the Standard is broken, only that the writers of
|  the standard have accidentally ruled out a common coding practice.

  You're half right. The wording could have been clarified although I'm
not sure your suggestion is the way to do it. You're wrong in that this
practice has been ruled out. In practice most version of malloc (every
version I've seen) return a quantity alligned so that the block starts
on the most restrictive boundary.

  When I started reading your post I thought you were going to make the
point that you can't have C on a machine which has no single most
restrictive boundary, such as ints start odd and double start even.
Fortunately I can't think of a reason to build such a machine, even to
start an argument.
-- 
bill davidsen	(davidsen at 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



More information about the Comp.std.c mailing list