Hi Doug,
On 7/27/22 15:23, Douglas McIlroy wrote:
I agree with all of Ingo's comments. A man page is a reference, not a
history, not a tutorial, not a style guide, There s nothing to say
about NULL beyond it's being a synonym for the constant 0 converted to
the null pointer. Other facts about the behavior of null pointers will
have been learned however or wherever one learned C.
The remark about segfaults is really about hardware, not about C.
Sometimes the undefined behavior can be made to manifest as a
segfault. But it is not an intrinsic property of null pointers.
Incidentally, I personally don't use NULL. Why, when C provides a
crisp notation, 0, should one want to haul in an extra include file to
activate a shouty version of it?
Even if I disagree with you on this, I think we both agree that adding a
third way to define a null pointer constant would be detrimental for all
of us.
ISO C2x has accepted a proposal to add C++'s nullptr to C:
<https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3042.htm>
And 2 days ago it went into the (possibly final) draft for C23:
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf>
See a discussion going on right now between me and several committee
members here:
<https://discourse.llvm.org/t/iso-c3x-proposal-nonnull-qualifier/59269/48>
Maybe you want to jump in and rant a little bit :)
The email to reply is:
LLVM Discussion Forums
<incoming+fa83fb1bc64f78f0a59b320bd7824...@llvm.discoursemail.com>
The latest message ID is:
<9ca964a8-c754-a15e-c674-f739763cc...@gmail.com>
And the subject is:
Re: ISO C3X proposal: nonnull qualifier
Cheers,
Alex