comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Put the access value
Date: Tue, 14 Apr 2020 09:42:53 +0200
Date: 2020-04-14T09:42:53+02:00	[thread overview]
Message-ID: <r73phu$58a$1@dont-email.me> (raw)
In-Reply-To: <5e956327$0$1635$e4fe514c@news.kpn.nl>

Le 14/04/2020 à 09:15, ldries46 a écrit :
> I just want to see if the routing of thedifferent Buffer_Pointer's is
> correct so I thought Buffer_Pointer'Image(El) would show the value of
> The Pointer El f.i. ?x000000 for null or even the simpel decimal value 0.
> 
> This construction creates a failure during compiling.
> Should I use another attribute or some other construction?
In Ada, a pointer is not an integer and has no 'Image attribute. A
pointer is not an address either. Of course, for debugging you can
indulge your self to constructs that would be thrown at for long term
maintenance. So...

1) Use Unchecked_Conversion to convert it to an appropriate integer type

2) use package Address_To_Access conversion to convert your pointer to
an address, then System.Storage_Elements.To_Integer to convert the
address to Integer_Address, which is an integer type.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

  reply	other threads:[~2020-04-14  7:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  7:15 Put the access value ldries46
2020-04-14  7:42 ` J-P. Rosen [this message]
2020-04-18 15:08   ` Oliver Kellogg
2020-04-20 23:02   ` Robert A Duff
2020-04-21  7:07     ` briot.emmanuel
2020-04-21 22:29       ` Robert A Duff
2020-04-14 11:05 ` Jeffrey R. Carter
2020-04-14 12:09   ` ldries46
2020-04-15  7:20     ` briot.emmanuel
2020-04-15  8:02       ` AdaMagica
2020-04-15  8:51         ` J-P. Rosen
2020-04-15 16:23           ` AdaMagica
2020-04-17 14:20         ` Björn Lundin
2020-04-21 21:06           ` Randy Brukardt
2020-04-22 12:31             ` Björn Lundin
2020-04-22 17:33               ` AdaMagica
2020-04-23 11:37                 ` Björn Lundin
replies disabled

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