[PATCH] Fix execl sentinels

Rich Felker dalias at aerifal.cx
Mon Jul 1 18:15:44 UTC 2013


On Mon, Jul 01, 2013 at 07:42:39PM +0200, walter harms wrote:
> The C-Reference Manual has a topic called
> "Null Pointers and Invalid Pointers"
> for anyone that like to go the source.
> 
> i like this one:
> "It is usual for alll null pointers to have a representation in which all bits are zero,
> but this is not required."

The representation of the null pointer is completely irrelevant to the
topic you replied to. C works with values, not representations.

Rich

> re,
>  wh
> 
> 
> Am 01.07.2013 19:27, schrieb Rich Felker:
> > On Mon, Jul 01, 2013 at 12:36:32PM -0400, Cathey, Jim wrote:
> >> Seems to me the C++ definition of NULL as "0" is what is garbage.
> >> It's been a zero void * for ages, why change it, then complain that
> >> it isn't big enough for a pointer on selected architectures?
> > 
> > Please, let's not bikeshed this. Unfortunately the definition of NULL
> > is a huge bikeshed topic, because everybody _THINKS_ it's something
> > easy they know the answer to, but unfortunately it's not.
> > 
> > NULL cannot be defined as ((void *)0) in C++ because C++ does not have
> > implicit conversions from void * to other pointer types. The
> > historical solution was to define it to 0. Defining it instead as a
> > zero whose type matches the size of pointer types is better. Defining
> > it to __null or similar is tempting but non-conforming to the standard.
> > 
> >> That's
> >> the whole reason it changed to a pointer from a simple zero thirty-odd
> >> years ago.
> > 
> > I must have missed that...
> > 
> > Rich


More information about the busybox mailing list