Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!psuvax1!news From: schwartz@groucho.cs.psu.edu (Scott Schwartz) Newsgroups: comp.lang.misc Subject: Re: Formal definitions (Re: ada-c++ productivity) Message-ID: Date: 22 Apr 91 00:56:04 GMT References: <1726@optima.cs.arizona.edu> <29344@dime.cs.umass.edu> <12318@dog.ee.lbl.gov> <14633@ulysses.att.com> Sender: news@cs.psu.edu (Usenet) Organization: PSU CS Lines: 12 In-Reply-To: kpv@ulysses.att.com's message of 21 Apr 91 17:24:59 GMT Nntp-Posting-Host: groucho.cs.psu.edu In article <14633@ulysses.att.com> kpv@ulysses.att.com (Phong Vo[drew]) writes: Just to make this concrete, the following example is mathematically correct given all the usual definitions of the C operators. It is incorrect because it is not portable. The "usual" definitions usually assume various nonportable things; part of the ANSI effort was to better specify the language. As an aside, K&R2 says that if the pointer resulting from address arithmatic points outside the array, the effect is undefined. Surely you couldn't show that example to be "mathematically correct" given that rule.