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,c88419bde98699ee,start X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Access vs. Address ? Date: 1996/04/08 Message-ID: <9604081423.AA03369@most>#1/1 X-Deja-AN: 146435094 sender: Ada programming language comments: Gated by NETNEWS@AUVM.AMERICAN.EDU mailer: Elm [revision: 70.85] newsgroups: comp.lang.ada Date: 1996-04-08T00:00:00+00:00 List-Id: > It is surprising how MUCH Ada code out there relies on the assumption > that all pointers are the same size as addresses. ... This assumption is normally accompanied by a more dangerous assumption that all pointers ARE addresses. Even though this is usually true, it IS NOT REQUIRED by either LRM. And even when it is true, what is happening is usually NOT what the programmer meant. I refer to the Unchecked_Conversion of an access value to an address when what is wanted is the address of the accessed item. begin -- Soapbox -- The address of Pointer.all is Pointer.all'Address -- -- it is NOT Convert_To_Address (Pointer); -- The latter works SOMETIMES with SOME compilers. And when it doesn't -- work, it can REALLY screw things up! end Soapbox; Feel free to share this with your beginning programmers :-) -- --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Magnavox - Mail Stop 10-40 Home: 219-471-7206 Fort Wayne, IN 46808 elm (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------