https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95700

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Ilya Leoshkevich from comment #0)
> musl has the following commit:
> https://git.musl-libc.org/cgit/musl/commit/
> ?id=c8a9c22173f485c8c053709e1dfa0a617cb6be1a, which suggests that C++ (as
> opposed to plain C) should allow plain (uintptr_t)0 as a sentinel value.

I don't understand. musl uses a null pointer constant of type long (i.e. 0L) so
where does the suggestion to allow (uintptr_t)0 come from?

If C provided a UINTPTR_C macro to produce an integer literal of type uintptr_t
then UINTPTR_C(0) would be a valid sentinel. I assume that doesn't exist
because C doesn't need such a type (because defining NULL to (void*)0 avoids
this problem).

Reply via email to