standards/62858: malloc(0) not C99 compliant

Stefan Farfeleder stefan at fafoe.narf.at
Tue Mar 2 14:40:00 PST 2004


On Mon, Mar 01, 2004 at 05:37:31PM +0100, Poul-Henning Kamp wrote:

> I want to make sure people who malloc(0) and then deref the pointer get
> the core dump they need to debug their problem.

So you want malloc(0) to return a different pointer to unmapped memory
every time it is called?

> But lets turn this around, do you have evidence of code which breaks
> with the current behaviour ?

I think only conformance checking software will notice this.

> Does the code also fail if you give
> malloc the 'V' flag ?

No, modulo PR bin/62859 where I forgot to CC you :)

Cheers,
Stefan


More information about the freebsd-standards mailing list