Re: Successful compilers for segment

10 Jan 86 15:46:00 GMT

          From comp.compilers

Related articles
Re: Successful compilers for segment compilers@ima.UUCP (1986-01-07)
Re: Successful compilers for segment compilers@ima.UUCP (1986-01-10)
Re: Successful compilers for segment compilers@ima.UUCP (1986-01-13)
| List of all articles for this month |

From: compilers@ima.UUCP
Newsgroups: mod.compilers
Date: 10 Jan 86 15:46:00 GMT
Article-I.D.: ima.136300045
Posted: Fri Jan 10 10:46:00 1986
Date-Received: 12 Jan 86 13:52:53 GMT

[from Davidsen <harvard!rochester!steinmetz!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]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.