3 procedure Unchecked_Union3
is
4 type small_array
is array (0 .. 2) of Integer;
5 type big_array
is array (0 .. 3) of Integer;
7 type small_record
is record
8 field1
: aliased Integer := 0;
9 field2
: aliased small_array
:= (0, 0, 0);
12 type big_record
is record
13 field1
: aliased Integer := 0;
14 field2
: aliased big_array
:= (0, 0, 0, 0);
17 type myUnion
(discr
: Integer := 0) is record
20 record1
: aliased small_record
;
22 record2
: aliased big_record
;
26 type UU_myUnion1
is new myUnion
;
27 pragma Unchecked_Union
(UU_myUnion1
);
28 pragma Convention
(C
, UU_myUnion1
);
30 procedure Convert
(A
: in myUnion
; B
: out UU_myUnion1
) is
31 L
: UU_myUnion1
:= UU_myUnion1
(A
); -- Test