comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Interfaces.C + generics: stack overflow
Date: Thu, 23 Mar 2017 15:03:19 -0500
Date: 2017-03-23T15:03:19-05:00	[thread overview]
Message-ID: <ob1a1t$b3d$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: ejhckeF1tg7U1@mid.individual.net

"hreba" <f_hreba@yahoo.com.br> 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.




  parent reply	other threads:[~2017-03-23 20:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  7:43 Interfaces.C + generics: stack overflow hreba
2017-03-23  7:46 ` hreba
2017-03-23 17:45 ` Jeffrey R. Carter
2017-03-24 12:20   ` hreba
2017-03-23 20:03 ` Randy Brukardt [this message]
2017-03-24 12:42   ` hreba
2017-03-24 20:13     ` Randy Brukardt
2017-03-24 22:03     ` Dmitry A. Kazakov
2017-03-25 14:17       ` hreba
2017-03-25 15:21         ` hreba
2017-03-26 22:34           ` Robert Eachus
2017-03-27  7:21             ` Dmitry A. Kazakov
2017-03-30 17:12               ` Robert Eachus
2017-03-25 15:23         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox