patch to clean out savestring, copystr, mybzero and mybcopy

Per Bothner bothner@cygnus.com
Mon Jan 11 19:16:00 GMT 1999


> I don't understand why one would go out of their way to prefer either style.

Because memcpy/memmove is standard ANSI C and bcopy is not.
Also, memcpy/memmove may be more marginally efficient and
clear to the reader, since the programmer specifies if overlap is possible.

>  Since these are host programs, we can't rely on libiberty.a (yet)

Huh?  Of course we can!  Host programs should all be linked with libiberty!
>From egcs/gcc/Makefile.in:
	# How to link with both our special library facilities
	# and the system's installed libraries.
	LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(CLIB) \
		../libiberty/libiberty.a

> I'd rather let sleeping dogs lie in this case and comtinue using bcopy.

I believe the policy is to gradually replace all uses of bcopy.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner



More information about the Gcc-patches mailing list