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,de68e4ddf10693 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Multiple pragma Imports Date: 1999/01/06 Message-ID: #1/1 X-Deja-AN: 429427863 Sender: matt@mheaney.ni.net References: <762u9n$kfn$1@nnrp1.dejanews.com> NNTP-Posting-Date: Wed, 06 Jan 1999 07:13:07 PDT Newsgroups: comp.lang.ada Date: 1999-01-06T00:00:00+00:00 List-Id: 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: private pragma Inline ("+"); pragma Inline ("-"); I'd rather be able to specify each subprogram individually in the pragma.