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,72a0bc6240d264e3 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Access and alias Date: 2000/04/09 Message-ID: #1/1 X-Deja-AN: 608818472 References: <8cp1m8$3v5$1@nnrp1.deja.com> X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 955310932 206.170.2.150 (Sun, 09 Apr 2000 13:08:52 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Sun, 09 Apr 2000 13:08:52 PDT Newsgroups: comp.lang.ada Date: 2000-04-09T00:00:00+00:00 List-Id: > > language and the Ada compiler? > > Where do you get that from? There is no requirement in the RM > for such a check, and indeed it would be very annoying, since > obviously for example C is quite capable of handling any > possible Ada parameter at the other end if parameters are > passed in a manner consistent with the ABI. The question in the post continued: >> language and the Ada compiler? For >> >> type Matrix is array(1 .. 10, 1 .. 5) of float; >> type pconstrained is access matrix; >> type List is array(integer range <>) of float; >> type punconstrained is access List; >> >> function cf(a : pconstrained; b : punconstrained) return float; >> pragma import(C, cf); >> >> Gnat 3.12p NT does indeed generate a nice diagnostic >> "type of cf.b does not correspond to C pointer". >> >> But it gives no warning for >> >> function Trace(M : in Matrix) return float; >> pragma import(Fortran, Trace); >> >> where of course Matrix is stored in one way in Ada and another >> in Fortran. Is this disparity just B.1(20)'s "The implementation >> permits T as an L-compatible type" with Gnat permitting >> Matrix but not punconstrained? > for example C is quite capable of handling any possible Ada parameter In that case, what, if anything, does RM B.1 (26) "For an imported or exported subprogram, the result and parameter types shall each be compatible with the convention specified in the corresponding program." require of the compiler?