[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doc malloc zero
From: |
Kevin Ryde |
Subject: |
Re: doc malloc zero |
Date: |
Fri, 28 May 2004 11:32:00 +1000 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) |
Eric Sunshine <address@hidden> writes:
>
> NextStep/OpenStep realloc() and free() crash when handed a null pointer.
Beaut, in that case:
`free'
The ISO C99 standard says a call `free(NULL)' does nothing, but
some old systems don't support this (eg. NextStep).
`malloc'
The ISO C99 standard says a call `malloc(0)' is implementation
dependent, it may either return `NULL' (eg. OSF 4) or non-`NULL'
(eg. GNU C Library). `AC_FUNC_MALLOC' can be used to insist on
non-`NULL' (*note Particular Functions::).
`realloc'
The ISO C99 standard says a call `realloc(NULL,size)' is equivalent
to a `malloc(size)', but some old systems don't support this (eg.
NextStep).