Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.6.2.16 $; site ima.UUCP Path: utzoo!decvax!ima!compilers From: compilers@ima.UUCP Newsgroups: mod.compilers Subject: Re: Successful compilers for segment Message-ID: <136300053@ima.UUCP> Date: Mon, 13-Jan-86 15:38:00 EST Article-I.D.: ima.136300053 Posted: Mon Jan 13 15:38:00 1986 Date-Received: Tue, 14-Jan-86 03:43:32 EST Lines: 31 Approved: compilers@ima.uucp Nf-ID: #N:ima:136300053:000:1401 Nf-From: ima!compilers Jan 13 15:38:00 1986 [from ihnp4!ho95e!wcs] In article <136300045@ima.UUCP> you write: >[from Davidsen ] >In article <136300020@ima.UUCP> compilers@ima.UUCP writes: >>.... >>You cannot produce a 'good' compiler for a segmented architecture for a >>language that has unbridled pointers, such as C. C comes with the built-in >>assumption that addresses are mappable onto the integers. > >Not so! X3J11 has carefully stated that there is no guarantee that integers >can hold any pointer value, or that any pointer value except (void *) and >(char *) can hold the address of another data type without data loss. In K&R I think you're misreading the original statement. When the author wrote: "addresses are mappable onto the integers" it could been talking about assigning pointers to ints, but was probably talking about mapping the space of valid addresses onto the mathematical set {1, 2, 3, 4, ...}, presumably 1:1 with a contiguous subset of the integers - in other words, "The memory of the machine looks like one long array, not a bunch of little pieces" which is untrue on segmented machines. -- # Bill Stewart, AT&T Bell Labs 2G-202, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs [I suspect that a piecewise continuous mapping would be sufficient. In any case, I'd rather drop this topic unless somebody from X3J11 or dmr has something definitive to say. -John] --------