[PATCH] Fix execl sentinels

Rich Felker dalias at aerifal.cx
Mon Jul 1 17:23:26 UTC 2013

On Mon, Jul 01, 2013 at 06:45:12PM +0200, Denys Vlasenko wrote:
> On Mon, Jul 1, 2013 at 5:13 AM, Rich Felker <dalias at aerifal.cx> wrote:
> > That's why we changed the definition in musl to 0L rather than 0.
> Expect C++ people to complain, because C++ standard says
> that NULL should be a null pointer literal (i.e. 0),
> not a long integer constant of value 0.

The definition of a null pointer constant (the word is constant, not
literal) is an expression that is either (a) an integer constant
expression with value 0, or (b) such an expression cast to void*. 0L
is an integer constant expression with value 0. Note that the second
option, using void*, is not acceptable for C++ because C++ lacks the
proper implicit conversions, and thus it's forbidden for C++.

The process I described took place with careful consideration of all
the standards involved, and even an analysis of whether there was any
conceivable sane code it could break:



More information about the busybox mailing list