From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d0475d4d02ffd8d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news4.google.com!news2.volia.net!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: To collection (GNAT bug) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1fo8mdcya4lc1.1xzuim6fz5a6a.dlg@40tude.net> <13weuafrdg7cx$.zkechwsuxyfw.dlg@40tude.net> <1c8Ug.2616$O5.1996@llslave.llan.ll.mit.edu> <1159982327.758504.26940@i42g2000cwa.googlegroups.com> Date: Wed, 4 Oct 2006 20:51:51 +0200 Message-ID: <16m4sr53fkumr$.h064l3w3xri7.dlg@40tude.net> NNTP-Posting-Date: 04 Oct 2006 20:51:44 CEST NNTP-Posting-Host: 08c422d1.newsspool4.arcor-online.net X-Trace: DXC=]kk:UiS^J39^cW`WBF>WQ<4IUKBAHCcIPBJA708:_OVP]lf9 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6868 Date: 2006-10-04T20:51:44+02:00 List-Id: On 4 Oct 2006 10:18:47 -0700, Adam Beneschan wrote: > 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. It is quite possible. The dope is obtained by dereferencing the address being converted. (I assume GNAT stores the dope in that fat pointer.) If Unchecked_Conversion did not restore a correct pointer under any thinkable circumstances, then its instantiation should be illegal. After all, GNAT is not required to provide it when sizes are different. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de