comp.lang.ada
 help / color / mirror / Atom feed
* Aliased Unchecked_Unions not seen or taken notice of
@ 2018-11-12 17:56 Lucretia
  2018-11-12 18:29 ` Lucretia
  2018-11-12 18:53 ` Per Sandberg
  0 siblings, 2 replies; 8+ messages in thread
From: Lucretia @ 2018-11-12 17:56 UTC (permalink / raw)


Hi,

I'm trying to binding the MPC parser library and have come upon an issue with unchecked_unions and aliased.

The error in my minimal sample is:

test.adb:36:07: prefix of "access" attribute must be aliased

Source:

procedure test is
   type Errors is null record with
     Convention => C;

   type Errors_Ptr is access Errors with
     Convention => C;

   type Values is null record with
     Convention => C;

   type Values_Ptr is access Values;

   type Results (Success : Boolean) is
   record
      case Success is
         when False =>
            Error : Errors_Ptr;

         when True =>
            Output : Values_Ptr;
      end case;
   end record with
     Convention      => C_Pass_By_Copy,
     Unchecked_Union => True;

   type Results_Ptr is access all Results with
     Convention => C;

   procedure B (R : in Results_Ptr) is
   begin
      null;
   end B;

   Result : aliased Results := (Success => False, others => <>);
begin
   B (Result'Access);
end test;


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

end of thread, other threads:[~2018-11-13  0:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 17:56 Aliased Unchecked_Unions not seen or taken notice of Lucretia
2018-11-12 18:29 ` Lucretia
2018-11-12 20:13   ` Dmitry A. Kazakov
2018-11-12 21:02     ` Lucretia
2018-11-13  0:14       ` Randy Brukardt
2018-11-12 18:53 ` Per Sandberg
2018-11-12 19:44   ` Lucretia
2018-11-13  0:17     ` Randy Brukardt

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