Path: utzoo!attcan!uunet!bu.edu!transfer!crackers!samsung!umich!caen!sdd.hp.com!hplabs!otter.hpl.hp.com!hpltoad!cdollin!kers From: kers@hplb.hpl.hp.com (Chris Dollin) Newsgroups: comp.lang.misc Subject: Re: Answers, Chapter 1: TeX (was C's sins... and others) Message-ID: Date: 24 Oct 90 09:25:35 GMT References: <26726@megaron.cs.arizona.edu> Sender: news@hplb.hpl.hp.com (Usenet News Administrator) Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 41 In-Reply-To: gudeman@cs.arizona.edu's message of 23 Oct 90 22:48:21 GMT Nntp-Posting-Host: cdollin.hpl.hp.com David Gudeman writes: In article <3656@lanl.gov> jlg@lanl.gov (Jim Giles) writes: ]Of course, pointers and one dimensional arrays - in spite of their ]similarity - are indeed different. For one thing: arrays are bounded. You know, Jim, it doesn't help your argument any when you keep bringing up the same points long after they have been discredited. Pointers are bounded just like array indexes. Yes, most implementations of C don't check the bounds, but that is because in the definition of the C language, run-time errors are generally [rest omitted] That's not what Jim means by "bounded" (if I understand him correctly) - his point is that given two *arrays* A, B then it is *known* that A and B have no locations (ie, updatable bits of store) in common, so assignments within A cannot affect the values accessible from B. This is in contrast to two pointers P, Q (of the same type); an assignment through P (*P = 42, or P[42] = MAX_INT) might well change values accessible through Q. Jim wants ALIAS declarations for the cases where variables can overlap. Presumably in the case of a procedure with a header something like void example( T A[Bound], T B{Bound] ) ... where A and B are not to be aliased (so the comoiler can do its wizzy optimisations), all calls have a proof obligation to show that the actual arguments are *in fact* not aliased. Is that right, Jim? [I'm not sure I agree with Jim. But I'd rather disagree about the same thing that about two different ones, which is what I think David is in danger of doing.] -- Regards, Kers. | "You're better off not dreaming of the things to come; Caravan: | Dreams are always ending far too soon."