This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH RFA] utils.c: Fix xcalloc (0, 0) behavior


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]