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,8ceb83dbf250e264 X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: Problem with instantiating generic procedure Date: 1999/07/19 Message-ID: #1/1 X-Deja-AN: 502760926 References: <7mqfcq$9og$1@pegasus.csx.cam.ac.uk> <7ms4en$kl8$1@pegasus.csx.cam.ac.uk> <7mtt6e$ec0$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cygnus.stuttgart.netsurf.de X-Trace: deneb.cygnus.stuttgart.netsurf.de 932369610 2246 192.168.0.1 (19 Jul 1999 07:33:30 GMT) Organization: Penguin on board Mime-Version: 1.0 User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) XEmacs/21.1 (20 Minutes to Nikko) NNTP-Posting-Date: 19 Jul 1999 07:33:30 GMT Newsgroups: comp.lang.ada Date: 1999-07-19T07:33:30+00:00 List-Id: Robert Dewar writes: > But the name space pollution is a minimal problem, because it > occurs only in private parts or in package bodies, not in > package specs. Thanks, I wasn't aware of this. > I would guess this is in practice of minimal importance. In all > the use of GNAT so far, this issue has never come up, so it is > certainly not something that many people expect to be there! This seems to be case for this specific use of pragma Import as well, because GNAT 3.11p generates bad code for your example. ;) (A call to procedure q (with or without an integer argument) results in a `call q' instruction in both cases, which is certainly wrong.) > package p is > procedure q; > procedure q (x : integer); > private > procedure q_no_args renames q; > procedure q_int_arg (x : integer) renames q; > > pragma Import (C, q_no_args); > pragma Import (C, q_int_arg); > > end p; The renaming declaration are `in the wrong direction', I guess. Something like this is required instead: package p is procedure q; procedure q (x : integer); private procedure q_no_args; procedure q_int_arg (x : integer); pragma Import (C, q_no_args); pragma Import (C, q_int_arg); procedure q renames q_no_args; procedure q (x : integer) renames q_int_arg; end p;