From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: To collection (GNAT bug)
Date: Wed, 4 Oct 2006 10:01:48 +0200
Date: 2006-10-04T10:00:28+02:00 [thread overview]
Message-ID: <1ulni4ytiwx9b$.h3yhtyxju4op.dlg@40tude.net> (raw)
In-Reply-To: 5ByUg.89026$aJ.31485@attbi_s21
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
next prev parent reply other threads:[~2006-10-04 8:01 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
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 [this message]
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