comp.lang.ada
 help / color / mirror / Atom feed
* Convention Question related to access types
@ 2019-06-07  1:51 Jere
  2019-06-08  5:11 ` Randy Brukardt
  0 siblings, 1 reply; 2+ messages in thread
From: Jere @ 2019-06-07  1:51 UTC (permalink / raw)


The RM in section B.1 talks about Ada Standard requirements for
convention compatibility.  In it however it doesn't mention anything
about private types, full views, etc.

Say you are wanting to bind to an opaque type in C:

   package Bindings is
      type Opaque_Type(<>) is limited private;
      type Binding is access Opaque_Type with Convention => C;

      procedure Some_Procedure(Value : Binding) with Import, Convention => C;

   private

      type Opaque_Base is limited null record with Convention => C;
      type Opaque_Type is new Opaque_Base;

   end Bindings;

GNAT happily accepts that, but I am unsure if that is because
of the "The implementation permits T as an L-compatible type." 
part or because Opaque_Base is a proper convention compatible
type and Opaque_Type derives from it and is thus convention
compatible as well, even though it is a private type.  

I couldn't find anything dictating whether the convention 
compatibility rules applied the to full view or the public
view.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-08  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07  1:51 Convention Question related to access types Jere
2019-06-08  5:11 ` Randy Brukardt

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