This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bcopy in system.h should use memmove
- To: grahams at rcp dot co dot uk
- Subject: Re: bcopy in system.h should use memmove
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 18 Jan 1999 08:00:22 -0700
- cc: Richard Henderson <rth at cygnus dot com>, egcs-bugs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <36A341C3.44C9@rcp.co.uk>you write:
> Richard
>
> Thank for doing the patch.
>
> I've been thinking about the least error prone way of replacing
> uses of bcopy() with memcpy() or memmove() as appropriate.
>
> It has been noted before that manually changing bcopy () is
> error prone because one has to remember to swap the first two
> parameters around when replacing with one of the memxxx routines.
Considering that one does need to actually look at the operands to the
bcopy to determine if memcpy or memmove is appropriate, I think I'd prefer
each one to be fixed *by hand* so that people actually think about the
arguments and whether or not they can overlap.
This really didn't occur to me when I mentioned the possibility of using a
sed script.
jeff