🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2502

Re: Frustrated trying to be portable

#2502
From: Peter da Silva
Date: Mon, 25 Feb 1991 23:14
18 lines
1414 bytes
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?"
Technical Details
Message-ID: <N4Q94O2@xds13.ferranti.com>
Path: arc1-ca.pugleaf.net!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
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>

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