From: jerry@jvdsys.stuyts.nl (Jerry van Dijk)
Subject: Re: Multiple pragma Imports
Date: 1998/12/27
Date: 1998-12-27T00:00:00+00:00 [thread overview]
Message-ID: <F4LKJL.7z@jvdsys.stuyts.nl> (raw)
In-Reply-To: 762u9n$kfn$1@nnrp1.dejanews.com
dewar@gnat.com wrote:
: function Junk return Integer;
: pragma Import (C, Junk, "junk");
: function Junk return My_Integer;
: pragma Import (C, Junk, "junk");
The real problem, IMHO, is that you can overload the Ada
subprogram, but not the interfacing pragma.
: We have fixed GNAT to properly reject the above program,
: but we suspect that the above construction is quite
: common, and that other compilers besides GNAT have
: accepted this in the past.
What I (but then, who am I... :-) would like to see in an ideal world is:
Short Term:
a) GNAT follows the RM;
b) GNAT issuing an error if an interfacing pragma matches more
than one subprogram signature;
c) GNAT having a switch to revert to its old behaviour to enable
use of current bindings, to be fased out at some later date;
d) Other compilers following GNAT.
Long Term:
Serious discussion for the ARG on this subject.
I do not think the idea of having the pragma apply to the the
next uncompleted subprogram is the right one, as this would force
the pragma to follow the subprogram declaration immediately. Whereas
it is common idiom to put the interfacing pragmas in the private part
of a specification.
To get the behaviour I would like to see, the interfacing pragmas should
somehow be able to discern between the different subprogram signatures.
Maybe this calls for some extended interfacing pragma form, to be
implemented by general consensus.
But, I immediately admit I'm no language expert...
Jerry.
--
-- Jerry van Dijk | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada
-- Ada & Win32: http://stad.dsl.nl/~jvandyk
next prev parent reply other threads:[~1998-12-27 0:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-26 0:00 Multiple pragma Imports dewar
1998-12-27 0:00 ` Jerry van Dijk [this message]
1998-12-27 0:00 ` Larry Kilgallen
1998-12-27 0:00 ` Tom Moran
1998-12-28 0:00 ` dewar
1998-12-27 0:00 ` Jerry van Dijk
1998-12-28 0:00 ` dewar
1998-12-28 0:00 ` Jerry van Dijk
1998-12-28 0:00 ` dewar
1998-12-28 0:00 ` Tom Moran
1999-01-06 0:00 ` Matthew Heaney
1999-01-07 0:00 ` dewar
1999-01-07 0:00 ` Robert I. Eachus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox