🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2466

Re: Frustrated trying to be portable

#2466
From: Rahul Dhesi
Date: Thu, 21 Feb 1991 19:09
18 lines
1301 bytes
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 <dhesi%cirrusl@oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi
Technical Details
Message-ID: <2960@cirrusl.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!olivea!tymix!cirrusl!sunstorm!dhesi
References: <1991Feb17.203337.20569@uokmax.ecn.uoknor.edu> <15240@smoke.brl.mil> <4188@skye.ed.ac.uk> <1991Feb20.175318.28496@zoo.toronto.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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