Frustrated trying to be portable

Peter da Silva peter at ficc.ferranti.com
Tue Feb 26 10:14:52 AEST 1991


In article <2960 at cirrusl.UUCP> dhesi%cirrusl at oliveb.ATC.olivetti.com (Rahul Dhesi) writes:
> [You can't implement it portably].  My portable solution, is to assume that
> the caller of memmove() always knows the direction of the move.

Are you sure? Either one of two situations exists:

	The pointers are into the same object.
	The pointers are into different objects.

In the former case, overlap is a problem but you can compare them for
magnitude. In the latter case, overlap is not a problem. The result of
comparing two pointers into different objects is undefined but when you
don't care about the result why worry?

(or is this one of those cases where "undefined" means "run nethack"?)
-- 
Peter da Silva.  `-_-'  peter at ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"



More information about the Comp.std.c mailing list