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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-08 02:14:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news-lond.gip.net!news-raspail.gip.net!news.gsl.net!gip.net!fr.clara.net!heighliner.fr.clara.net!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: Michal Nowak Newsgroups: comp.lang.ada Subject: Placement of pragma Import Date: Sun, 08 Dec 2002 11:23:16 +0100 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: 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 1039342443 29110 137.194.161.2 (8 Dec 2002 10:14:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 8 Dec 2002 10:14:03 +0000 (UTC) Return-Path: X-Mailer: Calypso Version 3.30.00.00 (3) 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 X-Reply-To: vinnie@inetia.pl 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:31546 Date: 2002-12-08T11:23:16+01:00 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 -- -- -----------------------------------------------------------------