More on strcpy()
00704a-Liber
nevin1 at ihlpf.ATT.COM
Sat Apr 16 08:56:40 AEST 1988
In article <3477 at haddock.ISC.COM> karl at 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."
/ (_</_\/ <__/ / <_ These are solely MY opinions, not AT&T's, blah blah blah
More information about the Comp.lang.c
mailing list