Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: malloc(0) Message-ID: <13502@smoke.BRL.MIL> Date: 7 Aug 90 12:23:09 GMT References: <13384@smoke.BRL.MIL> <1990Jul26.232216.15093@oresoft.com> <1990Aug6.142050.18629@gli.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <1990Aug6.142050.18629@gli.com> bobj@gli.com (Robert Jacobs) writes: >About using malloc(0) to point to a unique place. What's wrong with using >malloc(1) ?? >That way malloc(0) would do what is expected. Return a NULL pointer. >This just seems too easy, doesn't it? Yes, it seems too easy because it is too easy. The issue was that it is not clear what to "expect" malloc(0) to return. The standard was deliberately vague on this point, because X3J11 was fairly evenly divided on the issue, but in much better agreement that it wasn't such an important point that it had to be nailed down in the spec.