comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: To collection (GNAT bug)
Date: 4 Oct 2006 10:18:47 -0700
Date: 2006-10-04T10:18:47-07:00	[thread overview]
Message-ID: <1159982327.758504.26940@i42g2000cwa.googlegroups.com> (raw)
In-Reply-To: u0sk26qjz46b$.1v1mgzx5feup8$.dlg@40tude.net

Dmitry A. Kazakov wrote:
> On Mon, 02 Oct 2006 09:06:42 -0400, Frank J. Lhota wrote:
>
> > Dmitry A. Kazakov wrote:
> >> On Sun, 01 Oct 2006 19:23:26 GMT, Jeffrey R. Carter wrote:
> >> However, I don't think that it was really the intended behavior in this
> >> case. [ If access String is a fat pointer, then Unchecked_Conversion should
> >> not be allowed at all. Otherwise it must honor the String's dope. ]
> >
> > I would agree that an unchecked conversion between an address and a fat
> > pointer (or any two types of different sizes, for that matter) should at
> > least trigger a warning.
>
> Well, actually, it gives a warning, that sizes are different.

Ummm, wait a minute.  If the sizes are different, why did you think
that the Unchecked_Conversion would be reversible?  I tried your
example on GNAT (Linux/x86), and it told me that X'Size=64 and
Addr'Size=32.  When you convert the 64-bit type to the 32-bit type, of
course you will lose some information that you won't recover when you
get it back.  It's mathematically impossible for this to be reversible.

                              -- Adam




  reply	other threads:[~2006-10-04 17:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-30 19:46 To collection (GNAT bug) Dmitry A. Kazakov
2006-10-01  1:21 ` Jeffrey R. Carter
2006-10-01  8:00   ` Dmitry A. Kazakov
2006-10-01 19:23     ` Jeffrey R. Carter
2006-10-01 22:33       ` Frank J. Lhota
2006-10-02  3:08         ` Jeffrey R. Carter
2006-10-02 13:02           ` Frank J. Lhota
2006-10-02 19:50             ` Jeffrey R. Carter
2006-10-02  8:23       ` Dmitry A. Kazakov
2006-10-02 13:06         ` Frank J. Lhota
2006-10-02 13:43           ` Dmitry A. Kazakov
2006-10-04 17:18             ` Adam Beneschan [this message]
2006-10-04 18:51               ` Dmitry A. Kazakov
2006-10-02 19:45         ` Jeffrey R. Carter
2006-10-03  8:36           ` Dmitry A. Kazakov
2006-10-03 19:10             ` Jeffrey R. Carter
2006-10-04  8:01               ` Dmitry A. Kazakov
2006-10-04  9:27                 ` Georg Bauhaus
2006-10-04 12:10                   ` Dmitry A. Kazakov
replies disabled

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