comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Convention Question related to access types
Date: Thu, 6 Jun 2019 18:51:29 -0700 (PDT)
Date: 2019-06-06T18:51:29-07:00	[thread overview]
Message-ID: <15a1e593-42f5-4f80-a84c-c5b6d3f1ef7b@googlegroups.com> (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.

             reply	other threads:[~2019-06-07  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07  1:51 Jere [this message]
2019-06-08  5:11 ` Convention Question related to access types Randy Brukardt
replies disabled

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