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!news2.google.com!news4.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed.arcor.de!newsspool1.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> <87fgklu009fm$.1jy0dch55kk6a.dlg@40tude.net> <5ByUg.89026$aJ.31485@attbi_s21> Date: Wed, 4 Oct 2006 10:01:48 +0200 Message-ID: <1ulni4ytiwx9b$.h3yhtyxju4op.dlg@40tude.net> NNTP-Posting-Date: 04 Oct 2006 10:00:28 CEST NNTP-Posting-Host: 8dc254e0.newsspool4.arcor-online.net X-Trace: DXC=>FjbMVC?\k:TQL:hoD@>T?4IUK7enW;^6ZC`4F0oL On Tue, 03 Oct 2006 19:10:57 GMT, Jeffrey R. Carter wrote: > Dmitry A. Kazakov wrote: >> >> No. These aren't equivalent. In many cases the programmer does not know >> what he is doing on the level of bits and bytes. Otherwise he probably >> wouldn't instantiate Unchecked_Conversion, but wrote a conversion of his >> own. He only knows the semantics of an object and asks the compiler to >> convert the types according to this semantics. It is a deal - the >> programmer knows the semantics, the compiler does the representation. > > I think you misunderstand the meaning of unchecked. 'Unchecked_Access > tells the compiler that this access value will not violate the > accessibility rules, even though the compiler thinks it will. > Unchecked_Deallocation tells the compiler that there are no other > references to this designated object, even if there are. And > Unchecked_Conversion means to interpret the bit pattern starting with > the bits of this value as being of that type, whether it makes sense or > not. It does not involve a change of representation. In terms of object > code, Unchecked_Deallocation does nothing; it merely provides a way > around the restrictions of the language. IFF "The representation of S is a representation of an object of the target subtype" [13.9(10)] BUT "Otherwise, the effect is implementation defined; in particular, the result can be abnormal" [13.9(11)] For example, when an array indexed by a 8-bit modular type is converted to an array indexed by 32-bit integer, then surely the dope will have a different bit pattern, and size. 13.9(14) even suggests that the dope size does not count as "size." ARM does not prohibit reasonable implementations of Unchecked_Conversion. OK, it does not enforce them either. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de