Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2001 00:09:25 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mike Barcroft <mike@FreeBSD.org>
Cc:        <freebsd-standards@bostonradio.org>
Subject:   Re: string.diff for review
Message-ID:  <20011130235621.W1251-100000@gamplex.bde.org>
In-Reply-To: <20011128024424.E14652@espresso.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 28 Nov 2001, Mike Barcroft wrote:

> Mike Barcroft <mike@FreeBSD.org> writes:
> > Patch attached; comments appreciated.
>
> This patch has some issues.  It is missing the removal of the asm
> versions of bzero() and others.  I also don't think the tree is ready
> for macro versions of these functions just yet, so I'm going to
> separate the replacement of bzero and others from the other changes
> and generate a new patch.

I think it is a mistake to replace any of the functions (that are already
implemented as functions) by macros.  The recommendation in the standard
to replace bzero() by a macro that calls memset() is for applications,
not implementations.

> Index: include/strings.h

POSIX standardized too many SysV mistakes :-(.

> +#define	bcmp(b1, b2, len)	memcpy((b1), (b2), (size_t)(len))

Should use memcmp() and translate the return code if the macro version is
kept (see sys/libkern.h to how not to do the reverse of this implementation.
memcmp() can't be implemented using bcmp() because bcmp() doesn't return
a trinary value).

I'll wait for the patch without any changes to bzero() and others before
reviewing this any more.  The patch should be much smaller :-).

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011130235621.W1251-100000>