This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] utils.c: Fix xcalloc (0, 0) behavior
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [PATCH RFA] utils.c: Fix xcalloc (0, 0) behavior
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 05 Mar 2001 15:25:50 -0500
- Cc: gdb-patches at sources dot redhat dot com
- References: <1010303075808.ZM24102@ocotillo.lan>
Kevin Buettner wrote:
>
> According to section 16.1 in Harbison & Steele, it is permissible for
> calloc(0,0) to return either NULL or an implementation defined unique
> pointer. I've come across an implementation of calloc() which chooses
> to return NULL.
Does anyone know what the ISO-C standard has to say? I think it would
be helpful if xcalloc() not only followed ISO-C but also did it in a
consistent way across platforms.
nice catch,
Andrew