Path: utzoo!attcan!uunet!mcvax!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.c Subject: Re: no noalias not negligible Message-ID: <7552@boring.cwi.nl> Date: 24 May 88 00:45:53 GMT References: <54080@sun.uucp> <1988May21.030207.25063@light.uucp> <4152@haddock.ISC.COM> Organization: CWI, Amsterdam Lines: 17 In article <1988May21.030207.25063@light.uucp> bvs@light.UUCP (Bakul Shah) writes: >In article <54080@sun.uucp> dgh%dgh@Sun.COM (David Hough) writes: >>Anyway there is no portable way in draft ANSI C to say "this pointers are >>guaranteed to have no aliases". > >How about adding a test before the for loop? Something like: >#define overlap(x,y,n) (!(x + n <= y || y + n <= x)) > if (overlap(dx, dy, n)) > return complain("overlapping arrays\n"); > Note however that in many cases it is much more difficult to ascertain overlap (i.e. 2 columns of matrices). And there are cases where it is just as difficult as the operations themselves. -- dik t. winter, cwi, amsterdam, nederland INTERNET : dik@cwi.nl BITNET/EARN: dik@mcvax