comp.lang.ada
 help / color / mirror / Atom feed
From: "W. Wesley Groleau (Wes)" <wwgrol@PSESERV3.FW.HAC.COM>
Subject: Access vs. Address ?
Date: 1996/04/08
Date: 1996-04-08T00:00:00+00:00	[thread overview]
Message-ID: <9604081423.AA03369@most> (raw)

> 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
---------------------------------------------------------------------------




             reply	other threads:[~1996-04-08  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-08  0:00 W. Wesley Groleau (Wes) [this message]
1996-04-08  0:00 ` Access vs. Address ? Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox