From -8945826919520926464
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e94695845965b249
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1992-12-03 16:33:29 PST
Newsgroups: comp.std.c++
Path: sparky!uunet!microsoft!hexnut!jimad
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: Zero-length structures and pointer comparisons
Message-ID: <1992Dec03.200934.26919@microsoft.com>
Date: 03 Dec 92 20:09:34 GMT
Organization: Microsoft Corporation
References: <1992Nov30.195202.14370@ucc.su.OZ.AU> <1992Dec1.072440.824@jyu.fi> <1992Dec1.175548.16232@meaddata.com>
Lines: 31

In article <1992Dec1.175548.16232@meaddata.com> ralpht@meaddata.com (Ralph W. Trickey) writes:
|  The Intel 8086 series of chips (used in PC's) has a segmented
|architecture, this consists of a 16 bit segment and a 16 bit offset.
|The physical address is computed by segment << 4 + offset. Addresses
|for this chip are often done using only the offset portion. This
|allows access to 64K of memory, but is faster than using all 32 bits.

This statement is simply incorrect for any of the recent 80x86 chips
and for any of the recent OS's designed to use these chips.  Get and
read an 80486 manual for instance, which describes the various virtual memory
models available.

|  I don't think that requiring total ordering would break any existing
|program, but it would break quite a few existing compilers. 

You think wrong.  To quote from the ANSI-C rationale, existing implementations
don't matter -- existing CODE does.  MUCH existing code depends on partial
ordering.  And NOT just on PCs.

|  By requiring total ordering, you would force all < and > operations
|to compare both segment and offset. I commonly use a condition
|like this to test for termination of a loop, it would greatly slow
|down the execution of most programs written for a segmented
|architecture for little benefit that I can see.

Agreed.  For those people who happen to currently program on architectures
and OS's that present a particularly simple [and unscalable] linear
memory model, who want to restrict their coding efforts to that particular
memory model, then go ahead.  But don't try to force the rest of the world into
your restrictions.



