svn commit: r336835 - head/lib/libc/gen

Brooks Davis brooks at freebsd.org
Mon Jul 30 15:46:11 UTC 2018


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 at 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 standard
> > > conformance.
> > 
> > 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.
> > 
> > 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.
> 
> If you prefer (char *)NULL, please use it.
> 
> > 
> > > I am not so sure about CheriBSD, for instance.
> > 
> > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20180730/a4e385e8/attachment.sig>


More information about the svn-src-head mailing list