From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5697899e4423465c X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: null pointer representation (was: Boolean Representation) Date: 1998/09/30 Message-ID: #1/1 X-Deja-AN: 396530653 Cache-Post-Path: wagasa.cts.com!kst@king.cts.com References: <6umkbn$pv5$1@nnrp1.dejanews.com> <6uo7p6$dk4$1@nnrp1.dejanews.com> Organization: CTS Network Services Newsgroups: comp.lang.ada Date: 1998-09-30T00:00:00+00:00 List-Id: 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 <*> Qualcomm, San Diego, California, USA It takes a Viking to raze a village.