From: "Marc A. Criley" <mcquadex@earthlink.net>
Subject: Thin pointers and the GNAT RM
Date: Fri, 02 Feb 2001 15:05:26 GMT
Date: 2001-02-02T15:05:26+00:00 [thread overview]
Message-ID: <3A7ABEBC.F8A33272@earthlink.net> (raw)
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
next reply other threads:[~2001-02-02 15:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-02 15:05 Marc A. Criley [this message]
2001-02-02 16:43 ` Thin pointers and the GNAT RM Marc A. Criley
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox