More damage to intuition (was RE: [Python-Dev] Comparison of recursive objects)

Tim Peters
Mon, 22 Jan 2001 15:26:15 -0500

> IMHO, *this* *particular* gripe of Insure++ is just a pain in the
> butt, and I wish there was a way to turn it off in Insure++ without
> having to fix the code.

Maybe there is.  Barry?

> IMHO, this was included in the standard to allow segmented-memory
> implementations of C.  Think certain DOS or Windows 3.1 memory models
> where a pointer is a segment plus an offset.  This is not current
> practice even on Palmpilots!

I could ask Tom MacDonald (former X3J11 chair), but don't want to bother
him.  The way these things usually turn out:  the committee debated it 100
times over 10 years, but some committee member steadfastly claimed it was
important.  Since ANSI/ISO committees work via consensus, one implacable
objector is enough.

WRT pointers, I know that while the C committee did worry about segmented
architectures a lot in the past, tagged architectures gave them much
thornier problems (the HW tags each "word" with some manner of metadata
(such as a busy/free or empty/full bit, or read+write permission bits, or a
data type identifier, or a "capability" tag tying into a HW-enforced
security architecture, ...), and checks those on each access, and some of
the metadata can propagate into a pointer, and the HW can raise faults on
pointer comparisons if the metadata doesn't match).  While such machines
aren't in common use, the US Govt does all sorts of things they don't talk
about -- if it's not IBM's representative protecting a 40-year old
architecture, it's someone emphatically not from the NSA <wink> protecting
something they're not at liberty to discuss.  Of course Python wants to run
there too, even if we never hear about it ...

> The standard may say that such comparisons are undefined, but I don't
> care about this particular undefinedness, and I'm annoyed by the
> required patches.

Ya, and I'm annoyed that MS stdio corrupts itself -- but they're just
clinging to the letter of the std too, and I've learned to live with it
gracefully <wink>.

pointer-ordering-comparisons-should-be-very-rare-anyway-ly y'rs  - tim