bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: virtual memory exhausted when xmalloc(0) returns 0


From: Philip Guenther
Subject: Re: PATCH: virtual memory exhausted when xmalloc(0) returns 0
Date: Thu, 24 Mar 2005 18:42:47 -0800

Paul Smith <address@hidden> wrote:
>Just a note: the 1989 ANSI C standard (adopted as the ISO C standard in
>1990) required that malloc(0) return a valid pointer, so any system that
>doesn't provide this capability is not even compliant with the most
>basic, bare minimum set of standards required by POSIX, which has been
>in place for 16 years.

Please double check your source.  The C FAQ, as regularly posted
to comp.lang.c.moderated and cited by various authorities there and
in comp.lang.c, claims otherwise:
        http://www.eskimo.com/~scs/C-faq/q11.26.html


Actually, it's my understanding that the C FAQ's answer is true for
C89/C90, but that C99 changed that to require malloc(0) to return
a unique pointer on success, a NULL pointer on failure.  So those
systems are only six years out of date, not 16.


Philip Guenther




reply via email to

[Prev in Thread] Current Thread [Next in Thread]