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

Guido van Rossum guido@digicool.com
Mon, 22 Jan 2001 10:55:42 -0500


> Your faith in gcc is as charming as it is naive <wink>:  the most
> interesting cases of undefined behavior can't be checked no-way, no-how at
> compile-time.  That's why Barry keeps talking employers into dumping
> thousands of dollars into a single Insure++ license.  Insure++ actually tags
> every pointer at runtime with its source, and gripes if non-equality
> comparisons are done on a pair not derived from the same array or malloc
> etc.  Since Python type objects are individually allocated (not taken from a
> preallocated contiguous vector), Insure++ should complain about that
> compare.

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.

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!

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.

--Guido van Rossum (home page: http://www.python.org/~guido/)