bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memset (0, 0, 0);


From: Wolfram Gloger
Subject: Re: memset (0, 0, 0);
Date: Mon, 7 Apr 2003 11:44:21 +0200 (MDT)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]