This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bcopy in system.h should use memmove



  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]