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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5bef5e9c5bedc675 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-03 03:56:01 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!peernews-us.colt.net!colt.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: [No_Elaboration_Code] GNAT still generating rep_to_pos, why? Date: 03 Jan 2004 11:53:03 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1073130959 22947 62.49.19.209 (3 Jan 2004 11:55:59 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 3 Jan 2004 11:55:59 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:4068 Date: 2004-01-03T11:53:03+00:00 List-Id: "Luke A. Guest" writes: > This is my code: > > type T_SPB is > record > ... > end record; > > type T_SPB_PTR is access T_SPB; > > SP_Block : T_SPB; > for SP_Block'Address use System'To_Address(16#80001000#); > -- Tell the compiler that this record is defined elsewhere. > -- Stops the compiler from producing a warning. > pragma Import(Ada, SP_Block); Not sure whether this will help .. with System.Storage_Elements; package Luke is type P is access Integer; pragma Suppress_Initialization (P); type R is record The_P : P; end record; pragma Suppress_Initialization (R); V : R; for V'Address use System.Storage_Elements.To_Address (16#80001000#); -- pragma Import (Ada, V); end Luke; I found Suppress_Initialization at http://gcc.gnu.org/onlinedocs/gnat_rm/Implementation-Defined-Pragmas.html#Implementation%20Defined%20Pragmas but I don't know whether it is officially supported by ACT for the future (I tried it with 3.15p and 5.01a, the latter is closer to the GCC version). The key was to apply the pragma to type P. I've managed to get myself confused about which combination of options/compiler produced which effect, but I get the impression that there is a difference between 3.15p and 5.01a here .. I'm not familiar with System'To_Address .. neater than the Storage_Elements version, but more difficult to grep for in the source! -- Simon Wright 100% Ada, no bugs.