[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: memset (0, 0, 0);
From: |
Thomas,Stephen |
Subject: |
RE: memset (0, 0, 0); |
Date: |
Mon, 7 Apr 2003 11:42:44 +0100 |
Hi Wolfram,
xmalloc is an internal gdb routine. I just checked it, & it returns NULL for
size=0.
(malloc on our architecture does indeed return a proper address for size=0).
Steve Thomas
SuperH (UK) Ltd.
-----Original Message-----
From: Wolfram Gloger [mailto:address@hidden
Sent: 07 April 2003 10:44
To: Thomas,Stephen
Cc: address@hidden
Subject: Re: memset (0, 0, 0);
Hi,
> On the 1st time of calling, none of the gdbarch stuff is set up, so
> NUM_REGS = NUM_PSEUDO_REGS = 0. So xmalloc gets called with size=0.
> That returns 0 as the 'address', which gets passed to memset. I guess
> this just works OK on other architectures (it does on x86 anyway).
Actually on x86-linux, malloc(0) (and therefore xmalloc(0)) returns a unique
address, not NULL. Both behaviours are permitted by standard C.
Regards,
Wolfram.
- memset (0, 0, 0);, Joern Rennecke, 2003/04/04
- Re: memset (0, 0, 0);, Daniel Jacobowitz, 2003/04/04
- Re: memset (0, 0, 0);, Andrew Cagney, 2003/04/04
- Re: memset (0, 0, 0);, Andreas Schwab, 2003/04/04
- Re: memset (0, 0, 0);, Petr Vandrovec, 2003/04/04
- RE: memset (0, 0, 0);, Thomas,Stephen, 2003/04/07
- Re: memset (0, 0, 0);, Wolfram Gloger, 2003/04/07
- Re: memset (0, 0, 0);, Daniel Jacobowitz, 2003/04/07
- Re: memset (0, 0, 0);, Geoff Keating, 2003/04/07
- RE: memset (0, 0, 0);,
Thomas,Stephen <=
- RE: memset (0, 0, 0);, Thomas,Stephen, 2003/04/08