Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!pasteur!ames!pacbell!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.c Subject: Re: More on strcpy() Message-ID: <4443@ihlpf.ATT.COM> Date: 15 Apr 88 22:56:40 GMT References: <7712@apple.Apple.Com> <7485@brl-smoke.ARPA> <10731@mimsy.UUCP> <4343@ihlpf.ATT.COM> <10987@mimsy.UUCP> <4383@ihlpf.ATT.COM> <904@mit-caf.UUCP> <3477@haddock.ISC.COM> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 18 Distribution: In article <3477@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes: >Because, in order for this to work on both strcpy(s,s+1) and strcpy(s+1,s), >the implementation has to do extra work to guarantee nondestructiveness. If >strcpy is being inline-expanded by the compiler, this can be a significant >overhead which is seldom necessary. Actually, I don't think that it is even possible to nondestructively copy overlapping strings. The only thing that could possibly be guaranteed is that the dst string becomes what used to be the src string. That isn't being done now by most implementations of strcpy(), and I don't want to see it added due to it beingg inherently inefficient (especially since there *is* a function which can be used in it's place in those few situations which need it). -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_