strcpy

Doug Gwyn gwyn at brl-smoke.ARPA
Wed Mar 23 04:39:13 AEST 1988


In article <10753 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
-In article <7506 at brl-smoke.ARPA> gwyn at brl-smoke.ARPA (Doug Gwyn) writes:
->This usage was never a good idea, because a valid implementation of
->strcpy() would be to copy right-to-left rather than left-to-right
-I agree that a generic block copy operation (one of {memcpy, memmove}
----I cannot remember which allows overlap) might do this; I do not
-agree that strcpy() may be implemented that way.  (I could be wrong.)

I've never seen a specification of strcpy() that promised left-to-right
processing.  The dpANS specifies (redundantly, now that noalias
qualifiers are shown on the parameters) that copying between overlapping
objects results in undefined behavior.



More information about the Comp.lang.c mailing list