comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@s.netic.de>
Subject: Re: Problem with instantiating generic procedure
Date: 1999/07/19
Date: 1999-07-19T07:33:30+00:00	[thread overview]
Message-ID: <m3wvvxksad.fsf@deneb.cygnus.stuttgart.netsurf.de> (raw)
In-Reply-To: 7mtt6e$ec0$1@nnrp1.deja.com

Robert Dewar <robert_dewar@my-deja.com> 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;





  reply	other threads:[~1999-07-19  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-17  0:00 Problem with instantiating generic procedure Markus Kuhn
1999-07-17  0:00 ` Vladimir Olensky
1999-07-17  0:00 ` Florian Weimer
1999-07-18  0:00   ` Markus Kuhn
1999-07-18  0:00     ` Chad R. Meiners
1999-07-18  0:00     ` Florian Weimer
1999-07-19  0:00       ` Robert Dewar
1999-07-19  0:00         ` Florian Weimer [this message]
1999-07-18  0:00 ` David C. Hoos, Sr.
1999-07-19  0:00 ` Robert A Duff
1999-07-19  0:00 ` Tucker Taft
1999-07-19  0:00   ` Markus Kuhn
1999-07-23  0:00     ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox