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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Interfaces.C + generics: stack overflow Date: Thu, 23 Mar 2017 15:03:19 -0500 Organization: JSA Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1490299773 11373 24.196.82.226 (23 Mar 2017 20:09:33 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 23 Mar 2017 20:09:33 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:46444 Date: 2017-03-23T15:03:19-05:00 List-Id: "hreba" wrote in message news:ejhckeF1tg7U1@mid.individual.net... > My last posting was buried deep inside the thread and somewhat lengthy, so > here in a compact form. What works is (everything compiles and test > application executes): I agree with Jeff, there's not enough detail here to even see if there is a bug or your mistake. We need to know how/where the generic is instantiated, where/how the access-to-function value is created, and probably more. But let me say that the rules for access-to-subprogram types are different inside of generics than they are in normal packages, in order to allow for the possibility of generic sharing. That ought to manifest as compile-time errors and/or the raising of Program_Error, so it seems that there might be a compiler bug in your code. But to find that, one needs to see the whole thing, not just a little corner. If you really want to write portable interfacing code, you would not use any generics in the raw interface. (Have the generics call non-generic interface code with appropriate type conversions.) Janus/Ada doesn't allow any convention C stuff in generic units, because it is incompatible with the extra dope needed to implemented universal generic sharing. I'd expect something similar to happen for any implementation that supports almost any form of generic sharing. (If you only care about GNAT, do what ever you want.) Randy.