Date: Mon, 30 Jul 2018 15:46:03 +0000 From: Brooks Davis <brooks@freebsd.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Conrad Meyer <cem@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336835 - head/lib/libc/gen Message-ID: <20180730154603.GA49837@spindle.one-eyed-alien.net> In-Reply-To: <20180728214523.GC40119@kib.kiev.ua> References: <201807281908.w6SJ80qo089859@repo.freebsd.org> <20180728200611.GA40119@kib.kiev.ua> <CAG6CVpVEhyutDe7DL7ECVbKi=JpbD%2BAD8d633=eLX6-VbD4i9g@mail.gmail.com> <20180728203253.GB40119@kib.kiev.ua> <CAG6CVpV78tghDqgE-nGp0WeGZAxOpVp_y%2BpyZLob0DuRuHq_ug@mail.gmail.com> <20180728214523.GC40119@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 29, 2018 at 12:45:23AM +0300, Konstantin Belousov wrote: > On Sat, Jul 28, 2018 at 01:59:16PM -0700, Conrad Meyer wrote: > > On Sat, Jul 28, 2018 at 1:32 PM, Konstantin Belousov > > <kostikbel@gmail.com> wrote: > > > Our existing practice is to not provide an advise in the man pages > > > for the userspace code which would harm the portability or the standa= rd > > > conformance. > >=20 > > Perhaps, but you do not have to look beyond this manual page to find > > that such a practice, if it is even nominally applied, is not followed > > consistently. The remainder of the document spells the terminating > > value as plain "NULL." FreeBSD manual pages consistently refer to > > NULL as a pointer value. > >=20 > > The Linux manual page spells the terminating value (char *)NULL and > > explicitly documents why. That is perhaps both pedantically correct > > and clear. I am amenable to such a change. > I do not see much difference between (char *)0 and (char *)NULL. Both > are better there, because both are correct. >=20 > If you prefer (char *)NULL, please use it. >=20 > >=20 > > > I am not so sure about CheriBSD, for instance. > >=20 > > I observe simply that CheriBSD is not FreeBSD and that CHERI is an > > exotic architecture. > We should not give an advise which breaks other architectures, even > if not included into the mainline repo. CheriBSD would be fine because FreeBSD uses (void *)0 for NULL. That said, C++ requires that NULL be a bare 0 or nullptr so (char *)NULL is likely the most portable. -- Brooks --0F1p//8PRICkK4MW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbXzK7AAoJEKzQXbSebgfAOvQH/jXAUNrzJUb7QPKHK5JnfqvU RwwgQoo2PM4Gqis6tIgIgbYVHPIyqYfWmfrJTKcWPFzRq1IVGl3LHQ9xUO/YxI2R WyyTw/Nw7y1bfcmYdKqpOpMF78qcDg68EDlUvn5Oz1rbSh2aB2TgrRQmP7mSomAj 3V/cvk94+PDeGIqhApLRxgNKb66i1Y+FG+EDsBLhhE+HvEohw/9lmJSeP8Vm7Vf3 7gLh4rRINDdxBGODd509AVLlhYa9jwADh/v0BkkpUi6wU6LHnqD1CmB3AGuvSWZ3 2PwanPlwsZWTiFcQ5E+8UABi6eWSkiqGP9yjnDkIbSAxvyC0ctoqvfjYBAEjyZE= =oTja -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180730154603.GA49837>