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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7c0437014cb20f71 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: System.Address_to_Access_Conversions Date: 1998/07/14 Message-ID: <6ofqvs$alm@hacgate2.hac.com>#1/1 X-Deja-AN: 371347852 References: <6odddl$k94$1@nnrp1.dejanews.com> <35AB9C59.74E529E0@magic.fr> <6ofn8e$5ff$1@nnrp1.dejanews.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Hughes Aircraft Company Newsgroups: comp.lang.ada Date: 1998-07-14T00:00:00+00:00 List-Id: jsanchor@my-dejanews.com wrote in message <6ofn8e$5ff$1@nnrp1.dejanews.com>... >> No, the package is correct. I want to convert a system address to an access >type.-- With all due respect, sir you are wrong. Take a look at the package specification at the end of this message. Despite the package name, the package exports functions which convert both ways -- i.e., To_Address, and To_Pointer. Now, look at the function which returns an access value. The parameter of that function is of type System.Address, and the return type is Object_Pointer which is in turn declared as being an access to the generic formal type Object. Therefore, the type with which the package must be instantiated is the type of the object which you wish to locate at your specified address location -- not an access type or an address type, but the actual object type. However, there is another aspect of your original example which is a problem. Typically you will want to use a record representation clause to make the memory layout correspond to the harware requirements. Using a tagged type in such a sitiuation is not a good idea, because the tag is a "hidden" data field within the record which certainly will have no correspondence with the hardware-required memory layout. David C. Hoos, Sr. -- begin package System.Address_To_Access_Conversions -- generic type Object(<>) is limited private; package System.Address_To_Access_Conversions is pragma Preelaborate(Address_To_Access_Conversions); type Object_Pointer is access all Object; function To_Pointer(Value : Address) return Object_Pointer; function To_Address(Value : Object_Pointer) return Address; pragma Convention(Intrinsic, To_Pointer); pragma Convention(Intrinsic, To_Address); end System.Address_To_Access_Conversions; -- end package System.Address_To_Access_Conversions --