Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.std.c Subject: Re: Frustrated trying to be portable Message-ID: Date: 25 Feb 91 23:14:52 GMT References: <1991Feb17.203337.20569@uokmax.ecn.uoknor.edu> <15240@smoke.brl.mil> <4188@skye.ed.ac.uk> <1991Feb20.175318.28496@zoo.toronto.edu> <2960@cirrusl.UUCP> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 18 In article <2960@cirrusl.UUCP> dhesi%cirrusl@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@ferranti.com +1 713 274 5180. 'U` "Have you hugged your wolf today?"