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:32:33 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!feed.news.tiscali.de!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Re: [No_Elaboration_Code] GNAT still generating rep_to_pos, why? Date: Sat, 03 Jan 2004 11:32:32 +0000 Message-ID: References: <878ykp71fn.fsf@deneb.enyo.de> NNTP-Posting-Host: abyss2.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1073129552 4886 62.49.62.197 (3 Jan 2004 11:32:32 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 3 Jan 2004 11:32:32 +0000 (UTC) User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) Xref: archiver1.google.com comp.lang.ada:4067 Date: 2004-01-03T11:32:32+00:00 List-Id: On Sat, 03 Jan 2004 11:48:28 +0100, Florian Weimer wrote: > "Luke A. Guest" writes: > >> 1) There are two _rep_to_pos functions generated but never >> used. > > That's because you have an enumeration type with a non-standard > representation (see the GNAT source code). Yes, but I was wondering whether I could tell the compiler not to generate this code as I'm producing static initialisation here. >> 2) I have set up my SP_Block record instance to be located at a particular >> memory address, yet the compiler still generates code to initialise this >> structure. > > pragma Import with convention Ada (or C) should help. I've already mentioned this in an earlier part of the thread. 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); The compiler still generates that code. Luke.