[PATCH] Fix execl sentinels

Rob Landley rob at landley.net
Fri Jul 5 17:10:07 UTC 2013

On 07/01/2013 12:27:03 PM, Rich Felker wrote:
> 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 is a void *. I remember that from when I did C++ programming,  
which cares. C mostly doesn't care.

> NULL cannot be defined as ((void *)0) in C++ because C++ does not have
> implicit conversions from void * to other pointer types.

Yes. It's _expected_ to fail if you use NULL when you mean 0 in C++. I  
remember fixing more than one bug where I had to replace a "0" argument  
with a "NULL" argument so the stupid function overloading picked the  
right function.

> > That's
> > the whole reason it changed to a pointer from a simple zero  
> thirty-odd
> > years ago.
> I must have missed that...

Eh, more like 20 years ago in the compilers I was following. (1992 was  
the height of me thinking C++ was actually a good idea.)


More information about the busybox mailing list