🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2029

Re: Answers, Chapter 1: TeX (was C's sins... and others)

#2029
From: D. C. Sessions
Date: Mon, 12 Nov 1990 21:52
29 lines
2095 bytes
In article <5347@lanl.gov> jlg@lanl.gov (Jim Giles) writes:

>                                       Even on a PC, it's possible
>to implement pointers so that they can be compared no matter where
>they point (it just means that pointer compares are a little
>slower).  This should have been required by the standard.
 [...]
>J. Giles

Nice try, but unless you either (a) assume that the compiler is always 
emitting Ring 0 code, or (b) build in some very nonportable system calls
(and talk about SLOWER!), then there is no way to determine where the 
referents of two pointers are.  Both approaches require access to the 
segmentation mechanism (let alone the paging mechanism, which we'll ignore 
since your reference is to linear addresses).  Also, the results are 
volatile: even if you _do_ generate Ring 0 code, by the time the comparison 
is checked one of the segments may have moved.

Note that this argument applies to _any_ segmented memory architecture. 
The ANSI C standard could, of course, have jumped into the architecture
wars by specifying an underlying memory model.  (Why stop there?  How about
a language-defined byte order, too?)  If the standard _had_ explicitly 
excluded the 80x86 family, this whole discussion would be moot, since the 
standard would have been a dead letter.  C'est la guerre.
-- 
| The above opinions may not be original, but they are mine and mine alone. |
|            "While it may not be for you to complete the task,             |
|                 neither are you free to refrain from it."                 |
+-=-=-    (I wish this _was_ original!)        D. C. Sessions          -=-=-+
Technical Details
Message-ID: <845@mgt3.sci.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!sci34hub!sci!dc
References: <7AZ6O15@xds13.ferranti.com> <5347@lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!sci34hub!sci!dc
From: dc@sci.UUCP (D. C. Sessions)
Newsgroups: comp.lang.misc
Subject: Re: Answers, Chapter 1: TeX (was C's sins... and others)
Summary: Nice try, wrong
Message-ID: <845@mgt3.sci.UUCP>
Date: 12 Nov 90 21:52:57 GMT
References: <7AZ6O15@xds13.ferranti.com> <5347@lanl.gov>
Reply-To: dc@mgt3.sci.com (D. C. Sessions)
Organization: SCI Technology, Inc., Huntsville, Al.
Lines: 29