Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Contiguous Arrays Message-ID: <9773@smoke.BRL.MIL> Date: 2 Mar 89 22:54:01 GMT References: <2508@ssc-vax.UUCP> <8943@alice.UUCP> <1828@valhalla.ee.rochester.edu> <8966@alice.UUCP> <7389@killer.DALLAS.TX.US> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 22 In article <7389@killer.DALLAS.TX.US> chasm@killer.DALLAS.TX.US (Charles Marslett) writes: >> The easiest case is if I give you a strictly checking C implementation >> in which evaluating &space[0]-101 causes your program to terminate >> with an error diagnostic. >I did not disagree that it was possible to design a compiler/computer >combination that had this difficulty -- my point was that given the amount >of code it was likely to break, would anyone write such a compiler. There are compilers like that for architectures like that, as recently explained in detail by somebody else, and reasonably- written code works fine. Why do you think it should be valid to express the address of a nonexistent object? >Before the recent rounds of Ansi drafts, there was no requirement (oops, >someone may nail me on this, but if I err in detail, something had to be >unspecified) that sizeof(xxx) return the size of xxx in units of "char"s. Yes, the units of "sizeof" weren't specified. Since all common early implementations of C chose to use units of chars, too much code became utterly dependent on sizeof(char)==1. I argued for not requiring that in the proposed standard, but was outnumbered by those who wanted to retroactively bless that assumption.