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/07 Message-ID: #1/1 X-Deja-AN: 608122413 References: <8ckeup$9ed$1@nnrp1.deja.com> X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 955137514 207.214.211.45 (Fri, 07 Apr 2000 12:58:34 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Fri, 07 Apr 2000 12:58:34 PDT Newsgroups: comp.lang.ada Date: 2000-04-07T00:00:00+00:00 List-Id: >If the compiler DID use a different representation for the >two, I would say your prescription would be quite wrong, there >is absolutely no requirement in the RM for such conversions, >and pragmatically it would be a bad idea to molest parameters >in this way. So the effect of a pragma import on a function's parameters should not be to generate any code, but merely to check that the parameters' types are "compatible" between the external 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? The other part of the post was: >Is there also a requirement that it convert its idea of a >System.Address into the called language's idea of an access value? So the compiler should not convert System.Address to char *p, but may either permit it or flag it as it sees fit, with no required relationship to whether their memory representations match?