From: Keith Thompson <kst@king.cts.com>
Subject: Re: null pointer representation (was: Boolean Representation)
Date: 1998/09/30
Date: 1998-09-30T00:00:00+00:00 [thread overview]
Message-ID: <yec1zotnlor.fsf@king.cts.com> (raw)
In-Reply-To: 6uo7p6$dk4$1@nnrp1.dejanews.com
I posted a followup to this the other day, based on a misunderstanding
of what Robert had written (I somehow managed to read "cannot" as
"can"). I tried to cancel it; if the cancel didn't work, please
ignore my previous followup.
dewarr@my-dejanews.com writes:
> What is and is not safe to assume cannot be derived only from ISO standards!
> For all sorts of reasons, it is safe to assume that Null_Address is all
> zero bits. If you think this is wrong, cough up a counter example :-)
There are real systems out there on which the underlying operating
system uses a value other than all-bits-zero for null pointers. As
someone else pointed out, several examples can be found in question
5.17 of the C FAQ. On such a system, it would make perfect sense for
System.Null_Address to use the system's non-zero representation for a
null pointer. A C compiler on such a system would very likely use
all-bits-zero to cater to poorly written existing code, but there's no
need for an Ada compiler to do so.
Even if there weren't any such machines, I don't believe that the
assumption that System.Null_Address is all zero bits would be
justified -- though admittedly my argument would be a bit weaker.
> Still, of course it is better never to have to depend on this assumption
> if you can avoid it (the same comment applies exactly equivalently to C code)
Agreed.
--
Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst> <*>
Qualcomm, San Diego, California, USA <http://www.qualcomm.com>
It takes a Viking to raze a village.
next prev parent reply other threads:[~1998-09-30 0:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-09-24 0:00 Boolean Representation matthew_snyder
1998-09-24 0:00 ` dewarr
1998-09-24 0:00 ` matthew_snyder
1998-09-24 0:00 ` Tom Moran
1998-09-25 0:00 ` dewarr
1998-09-25 0:00 ` Tom Moran
1998-09-24 0:00 ` dennison
1998-09-25 0:00 ` dewarr
1998-09-25 0:00 ` Robert I. Eachus
1998-09-24 0:00 ` Samuel T. Harris
1998-09-25 0:00 ` dewarr
1998-09-27 0:00 ` Samuel T. Harris
1998-09-28 0:00 ` dewar
1998-09-24 0:00 ` dennison
1998-09-24 0:00 ` Keith Thompson
1998-09-25 0:00 ` dennison
1998-09-25 0:00 ` Keith Thompson
1998-09-26 0:00 ` Tucker Taft
1998-09-26 0:00 ` Keith Thompson
1998-09-27 0:00 ` null pointer representation (was: Boolean Representation) Arthur Evans Jr
1998-09-27 0:00 ` Keith Thompson
1998-09-28 0:00 ` dewarr
1998-09-28 0:00 ` Lieven Marchand
1998-09-28 0:00 ` Keith Thompson
1998-09-28 0:00 ` dewarr
1998-09-30 0:00 ` Keith Thompson [this message]
1998-10-02 0:00 ` Robert I. Eachus
1998-09-27 0:00 ` Boolean Representation dewarr
1998-09-27 0:00 ` dewarr
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox