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: <136300045@ima.UUCP> Date: Fri, 10-Jan-86 10:46:00 EST Article-I.D.: ima.136300045 Posted: Fri Jan 10 10:46:00 1986 Date-Received: Sat, 11-Jan-86 19:42:23 EST Lines: 28 Approved: compilers@ima.uucp Nf-ID: #N:ima:136300045:000:1544 Nf-From: ima!compilers Jan 10 10:46:00 1986 [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 (if you contend that X3J11 is not yet standard), there is an entire section detailing that integers are not the same as pointers (see table of contents, "Pointers are not Integers", pg 102). Because the language allows the assignment, even though expressly defined to be non-portable and posibly non-functional, some people assume that it must work. This is about as valid a statement as saying that "FORTRAN assumes division by zero is valid", because a divide by zero will compile. Please clearly label your opinions as such, lest someone mistake them for facts. [This is all true, but your moderator would appreciate some thought given to languages that take advantage of segments, as opposed to those that can be compiled to tolerate them. C probably falls in the class of those that just barely tolerate them, given that things like malloc() force you to treat all data pointers as being in the same address space, even though they may not have the same representation. -John]