Re: malloc(0) broken?

2002-11-23 Thread David Schultz
Thus spake Bruce Evans <[EMAIL PROTECTED]>: > On Sat, 23 Nov 2002, David Schultz wrote: > > > Thus spake Bruce Evans <[EMAIL PROTECTED]>: > > > ... C90 has a bogus requirement that > > > the pointer for malloc(0) be "unique", whatever that means. C99 only > > > requires that the objects pointed

Re: malloc(0) broken?

2002-11-23 Thread Bruce Evans
On Sat, 23 Nov 2002, David Schultz wrote: > Thus spake Bruce Evans <[EMAIL PROTECTED]>: > > ... C90 has a bogus requirement that > > the pointer for malloc(0) be "unique", whatever that means. C99 only > > requires that the objects pointed to by the results of malloc() be > > disjoint, and this

Re: malloc(0) broken?

2002-11-23 Thread David Schultz
Thus spake Bruce Evans <[EMAIL PROTECTED]>: > Er, malloc(0) is defined as returning either a null pointer or a pointer > to 0 bytes of allocated space. Which one it chooses to return is > implementation-defined, not undefined. C90 has a bogus requirement that > the pointer for malloc(0) be "uniqu

Re: malloc(0) broken?

2002-11-23 Thread Bruce Evans
On Fri, 22 Nov 2002, M. Warner Losh wrote: > In message: <[EMAIL PROTECTED]> > Marc Recht <[EMAIL PROTECTED]> writes: > : A malloc(0) returns always 0x800 on my system. This causes some third-party > : software to fail, because they expect malloc(0) to return NULL. Is this a > : bug or

Re: malloc(0) broken?

2002-11-22 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Marc Recht <[EMAIL PROTECTED]> writes: : A malloc(0) returns always 0x800 on my system. This causes some third-party : software to fail, because they expect malloc(0) to return NULL. Is this a : bug or a feature? malloc(3) doesn't mention anything. mal

Re: malloc(0) broken?

2002-11-22 Thread Giorgos Keramidas
On 2002-11-22 16:25, Marc Recht <[EMAIL PROTECTED]> wrote: > Hi! > > A malloc(0) returns always 0x800 on my system. This causes some third-party > software to fail, because they expect malloc(0) to return NULL. Is this a > bug or a feature? malloc(3) doesn't mention anything. malloc(3) does men

Re: malloc(0) broken?

2002-11-22 Thread Marc Recht
Then you didnt read malloc(3) well enough: V Attempting to allocate zero bytes will return a NULL pointer Oops. :) Thanks. Regards, Marc To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message

Re: malloc(0) broken?

2002-11-22 Thread Marc Recht
Feature in malloc and bug in third-party code. C99 says: [..] Thanks! Then I'll try to change it in the third-party app... Also see the V flag listed in malloc(3). Nice. Maybe I just make it my system's default.. Regards, Marc To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe

Re: malloc(0) broken?

2002-11-22 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Marc Recht writes: >Hi! > >A malloc(0) returns always 0x800 on my system. This causes some third-party >software to fail, because they expect malloc(0) to return NULL. Is this a >bug or a feature? malloc(3) doesn't mention anything. Then you didnt read malloc(3) w

Re: malloc(0) broken?

2002-11-22 Thread David Malone
On Fri, Nov 22, 2002 at 04:25:20PM +0100, Marc Recht wrote: > Hi! > > A malloc(0) returns always 0x800 on my system. This causes some third-party > software to fail, because they expect malloc(0) to return NULL. Is this a > bug or a feature? malloc(3) doesn't mention anything. Feature in malloc

malloc(0) broken?

2002-11-22 Thread Marc Recht
Hi! A malloc(0) returns always 0x800 on my system. This causes some third-party software to fail, because they expect malloc(0) to return NULL. Is this a bug or a feature? malloc(3) doesn't mention anything. Regards, Marc To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebs