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: evans@evans.pgh.pa.us (Arthur Evans Jr) Subject: null pointer representation (was: Boolean Representation) Date: 1998/09/27 Message-ID: #1/1 X-Deja-AN: 395373255 References: Organization: Ada Consulting Newsgroups: comp.lang.ada Date: 1998-09-27T00:00:00+00:00 List-Id: In article , Keith Thompson wrote: > Nor can we assume that a ... null pointer is represented as all-bits-zero Indeed not. Some years ago I was concerned about this very issue and asked around (probably on cla) about it. The answers were instructive. Most compilers did in fact use all zeros, but some other values were used, including one compiler (from IBM, I think) that used the HEX number DEAD BEEF. I suppose it really stood out in HEX dumps. Since I was interfacing to C-code in Ada-83 and code on the C side needed zero for null pointers, I ended up writing some extra code to ensure that value, even though the implementation I was then using represented the null pointer as zero. And then we never ported to another compiler, so that effort was wasted. Well, them's the breaks. Art Evans Make the obvious fix to my address.