commom malloc/free practice breaks standard - author strikes back

Richard H. Gumpertz rhg at cpsolv.UUCP
Fri Oct 20 17:43:34 AEST 1989


In article <11334 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>NO, it is NOT legal!  Sheesh.

OK, where in the standard does it say it is illegal?

>Wrong, wrong, wrong.  The Standard already says what was intended in
>this regard.  It did NOT intend for your interpretation to be applied.
>In fact, what you're asking for can be deduced as a special case from
>the existing specifications in the Standard; no additional wording is
>necessary to enforce this constraint.

Again, where in the standard does it say that?

Arguments that just make assertions without citation don't hold much water.
I cannot find anything that says conversion from "void *" to "obj *" cannot
round up.  In fact,I cannot find anything in the standard that says
      free((void *) (object *) malloc(sizeof(object)))
will work: the standard only says that
      free(malloc(sizeof(object)))
will work.  Please tell me what section I have overlooked or stop saying
the standard already has things that I cannot find.
-- 
==========================================================================
| Richard H. Gumpertz    rhg at cpsolv.UUCP -or- ...uunet!amgraf!cpsolv!rhg |
| Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 |
==========================================================================



More information about the Comp.std.c mailing list