From: "Marc A. Criley" <mcquadex@earthlink.net>
Subject: Re: Thin pointers and the GNAT RM
Date: Fri, 02 Feb 2001 16:43:20 GMT
Date: 2001-02-02T16:43:20+00:00 [thread overview]
Message-ID: <3A7AD5B0.3EE5001D@earthlink.net> (raw)
In-Reply-To: 3A7ABEBC.F8A33272@earthlink.net
I've been informed that the GNAT RM is in error, the correct clause uses
Standard'Address_Size:
type X is access all String;
for X'Size use Standard'Address_Size;
Marc
"Marc A. Criley" wrote:
>
> While perusing the super-secret GNAT 3.13p Reference Manual to detemine
> how to force a pointer to an unconstrained array to use a "thin"
> pointer, I found exactly what I was looking for:
>
> To specify a thin pointer, use a size clause for the type, for example:
>
> type X is access all String;
> for X'Size use System.Address'Size;
>
> However, employing this approach in a test program...
>
> -------------------------------------------
> with System;
>
> procedure Pt is
>
> type X is access all String;
> for X'Size use System.Address'Size;
>
> begin
> null;
> end Pt;
> --------------------------------------------
>
> ...produces the following error message:
>
> pt.adb:6:33: static integer expression required here
>
> By replacing "System.Address'Size" with 32, the code compiles and works
> correctly.
>
> (This information is also being sent to report@gnat.com.)
>
> Marc A. Criley
> Senior Staff Engineer
> Quadrus Corporation
> www.quadruscorp.com
prev parent reply other threads:[~2001-02-02 16:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-02 15:05 Thin pointers and the GNAT RM Marc A. Criley
2001-02-02 16:43 ` Marc A. Criley [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox