Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!uw-beaver!Teknowledge.COM!unix!hplabs!hp-pcd!hpcvlx!andreas From: andreas@hpcvlx.cv.hp.com (Jim Andreas) Newsgroups: comp.sys.hp Subject: Re: Re: X11R4 under HP-UX 7.0 Message-ID: <101950110@hpcvlx.cv.hp.com> Date: 18 Mar 90 00:31:14 GMT References: <1990Mar2.185840.24495@arnor.uucp> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 39 Regarding the: cannot perform realloc problem in clients in MIT X11R4: Yes the True Answer is to define MALLOC_0_RETURNS_NULL when you compile your libs. Here is the relevant code fragment from Xlibos.h in MIT X11R4 (./mit/lib/X/Xlibos.h): /* * Note that some machines do not return a valid pointer for malloc(0), in * which case we provide an alternate under the control of the * define MALLOC_0_RETURNS_NULL. This is necessary because some * Xlib code expects malloc(0) to return a valid pointer to storage. */ #ifdef MALLOC_0_RETURNS_NULL # define Xmalloc(size) malloc(((size) > 0 ? (size) : 1)) # define Xrealloc(ptr, size) realloc((ptr), ((size) > 0 ? (size) : 1)) # define Xcalloc(nelem, elsize) calloc(((nelem) > 0 ? (nelem) : 1), (elsize)) #else # define Xmalloc(size) malloc((size)) # define Xrealloc(ptr, size) realloc((ptr), (size)) # define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) #endif ----------------------------------------------------------------------- Jim Andreas | andreas@cv.hp.com | INTERNET Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!andreas | UUCP 1000 N.E. Circle | (USA) (503) 750-2860 | VOICE Corvallis, OR 97330 | (USA) (503) 750-3788 | FAX ----------------------------------------------------------------------- This response does not represent the official position of, or statement by, the Hewlett-Packard Company. The above data is provided for informational purposes only. It is supplied without warranty of any kind. -----------------------------------------------------------------------