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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!eu.feeder.erje.net!goblin1!goblin3!goblin.stu.neva.ru!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Thick bindings to a C library and gnattest: suggestions? Date: Tue, 02 Jul 2013 12:58:52 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1fxsf70zl2ckq.aysy7d9c8jkl$.dlg@40tude.net> <93fc7ff5-73b2-455a-85ae-3f3505144de2@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1372784332 25634 192.74.137.71 (2 Jul 2013 16:58:52 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 2 Jul 2013 16:58:52 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:4J9GLr3wKv6umFwodU+BX5UG2FY= Xref: news.eternal-september.org comp.lang.ada:16057 Date: 2013-07-02T12:58:52-04:00 List-Id: Maurizio Tomasi writes: > I do not understand what causes this problem: in both cases the > address of A's first element is not stored in a global variable but > used as the argument to a procedure call. So how can this be a > "non-local pointer"? If you pass a pointer as a parameter to some separately compiled procedure (written in Ada or C or whatever), the compiler can't very well know that the callee doesn't copy it into a global. Even locally, the compiler isn't required to track how you copy pointers around the place -- the rule is conservative, and based on the _type_. - Bob