Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!olivea!tymix!cirrusl!sunstorm!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.std.c Subject: Re: Frustrated trying to be portable Message-ID: <2960@cirrusl.UUCP> Date: 21 Feb 91 19:09:58 GMT References: <1991Feb17.203337.20569@uokmax.ecn.uoknor.edu> <15240@smoke.brl.mil> <4188@skye.ed.ac.uk> <1991Feb20.175318.28496@zoo.toronto.edu> Sender: news@cirrusl.UUCP Organization: Cirrus Logic Inc. Lines: 18 In <1991Feb20.175318.28496@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: It is not possible to implement memmove(), in particular, in portable C. This is unfortunately true. My portable solution, is to assume that the caller of memmove() always knows the direction of the move. The caller should therefore call either move_down() or move_up(), making the same sort of decision about direction of the move that memmove() would make anyway. And move_down() and move_up() *can* be portably implemented. Lazy ANSI-conformant implementors can still do: #define move_down memmove #define move_up memmove -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi