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,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9fdb4e673a488b12 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-08 03:13:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!teaser.fr!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Placement of pragma Import Date: Sun, 8 Dec 2002 05:12:14 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <200212081123160930.0047D332@smtp-po.inetia.pl> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-2" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1039345982 29305 137.194.161.2 (8 Dec 2002 11:13:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 8 Dec 2002 11:13:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:31547 Date: 2002-12-08T05:12:14-06:00 In my opinion, the best place to put it would be in the package body. After all, what you're declaring with the pragma Import is the _implementation_ of the procedure Asm_Coded. The fact that you're importing the implementation has nothing whatever to do with the specification, so it should not appear there. David C. Hoos ----- Original Message ----- From: "Michal Nowak" To: "comp.lang.ada usegroup->mailing list gateway" Sent: December 08, 2002 4:23 AM Subject: Placement of pragma Import > Hello all, > > I have a little question coming out of curiosity. > > I have an assembly routine (in fact it may be a C code, > or something other, it does not matter). > I'm importing this subroutine in a package. It is possible > to place pragma Import in two (maybe more?) places: > > -- Possibility 1: > > package Import_Test is > > procedure Asm_Coded; > > pragma Import (Assembler, Asm_Coded, "donothing"); > pragma Linker_Options ("nothing_asm.s"); > > end Import_Test; > > -- Possibility 2: > package Import_Test is > > procedure Asm_Coded; > > private -- Imported in private section > > pragma Import (Assembler, Asm_Coded, "donothing"); > pragma Linker_Options ("nothing_asm.s"); > > end Import_Test; > > And a simple program which makes use of the above package: > --------------------------------- > with Import_Test; > > procedure Test is > begin > Import_Test.Asm_Coded; > end Test; > --------------------------------- > > The generated assembly source for Import_Test and Test subprogram > is the same in both cases. The program behaves and links in the > same way in both cases, but such test is not a proper way to say > if something is correct (?) or not. > I disassembled the main executable file with objdump and there are > some differences. However, this analysis didn't gave me answer to > what I want to know: > - what is the difference between 1st and 2nd possibility (from Ada > point of view)? > - if there is a difference, how does it affect program behavior, > visibility rules, etc.? > - if there is no difference, why? > > Thanks for any info, > - Michal > > > -- ----------------------------------------------------------------- > -- ___ _ > -- / _ \ | | I Choose Ada: > -- | |_| | ___| | _____ The Most Trusted Name in Software (TM) > -- | _ | | __ | | __ | > -- |_| |_| |_____|_ |_____|_ http://www.adaic.org/whyada/choose.html > -- > -- ----------------------------------------------------------------- > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > >