[PATCH] Fix execl sentinels

Rich Felker dalias at aerifal.cx
Mon Jul 1 17:27:03 UTC 2013

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...


More information about the busybox mailing list