comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Multiple pragma Imports
Date: 1999/01/06
Date: 1999-01-06T00:00:00+00:00	[thread overview]
Message-ID: <m3r9t8whzw.fsf@mheaney.ni.net> (raw)
In-Reply-To: 762u9n$kfn$1@nnrp1.dejanews.com

dewar@gnat.com writes:

> I thought I would give a heads up on a problem we
> have found in GNAT that we suspect exists in other
> compilers (certainly DEC Ada 83 for example). Consider
> the following:
> 
>    function Junk return Integer;
>    pragma Import (C, Junk, "junk");
> 
>    function Junk return My_Integer;
>    pragma Import (C, Junk, "junk");
> 
> We have seen this pattern in several bindings, including
> the x11 bindings from Intermetrics. But the above code is
> in fact illegal.

[snip]

> I would be delighted to find out that my analysis is
> incorrect here, but I am pretty sure it is right, and I
> have discussed it with other folk, including Bob Duff,
> before posting here.


I really miss the DEC pragmas here, where you could specify the argument
type, the return type (for a function), and even the argument passing
mechanism, right there in the pragma.  

The Import pragma seems a bit anemic (as the example above
demonstrates), and I would have preferred that DEC pragmas been designed
into the language.

I've never liked the fact that one pragma applies to multiple
subprograms, for example:

  <declare a few "+" functions>
  <declare a few "-" functions>

private

  pragma Inline ("+");
  pragma Inline ("-");


I'd rather be able to specify each subprogram individually in the
pragma.






  parent reply	other threads:[~1999-01-06  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
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 [this message]
1999-01-07  0:00   ` Robert I. Eachus
1999-01-07  0:00   ` dewar
replies disabled

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