CVS difference for ai05s/ai05-0002-1.txt
--- ai05s/ai05-0002-1.txt 2006/03/18 06:09:22 1.1
+++ ai05s/ai05-0002-1.txt 2007/04/06 04:37:11 1.2
@@ -1,4 +1,4 @@
-!standard B.03(19) 06-03-15 AI05-0002-1/01
+!standard B.03(19) 07-04-05 AI05-0002-1/02
!standard B.03(39)
!class binding interpretation 04-08-31
!status work item 05-05-23
@@ -32,21 +32,36 @@
with
T is an access-to-object type, its designated type is L-compatible,
- and either its designated subtype is not an unconstrained array subtype
- or L is Ada.
+ and its designated subtype is not an unconstrained array subtype.
-Add after B.1(39) (in the Implementation Advice section):
+Add after B.3(71):
- The recommended level of support for an interfacing pragma specifying a
- convention other than Ada or Intrinsic does not include the following cases:
+ - An Ada function result is returned as by a C function with a C
+ result type which corresponds to the Ada function result type according
+ to the rules of correspondence given above for parameters of mode IN.
+
+Replace B.3(71.1/2):
- - An interfacing pragma applied to an object whose nominal subtype is
- an unconstrained array subtype.
+ An Ada parameter of a private type is passed as specified for the
+ full view of the type.
- - An Export or Convention pragma applied to a subprogram which has
- a parameter of an unconstrained array subtype.
+with
- - An interfacing pragma applied to a function with
+ An Ada parameter of a private type is passed as specified for the
+ full view of the type. An Ada function result of a private type is
+ returned as specified for the full view of the type.
+
+Add after B.3(62):
+ An implementation need not support an interfacing pragma specifying
+ convention C or C_Pass_By_Copy in the following cases:
+
+ - an interfacing pragma applied to an object whose nominal subtype is
+ an unconstrained array subtype;
+
+ - an Export or Convention pragma applied to a subprogram which has
+ a parameter of an unconstrained array subtype; or
+
+ - an interfacing pragma applied to a function with
an unconstrained array result subtype.
@@ -203,6 +218,27 @@
Nothing in this proposal would prevent an implementation from choosing this
approach.
+
+----
+
+The distinction between conventions C and C_Pass_By_Copy applies to function
+results in the same way as to IN mode parameters. Given this example,
+
+ type C_Rec is record X, Y : Interfaces.C.Int; end record;
+ pragma Convention (C, C_Rec);
+
+ type C_Pbc_Rec is record X, Y : Interfaces.C.Int; end record;
+ pragma Convention (C_Pass_By_Copy, C_Pbc_Rec);
+
+ function C_Func return C_Rec;
+ pragma Import (C, C_Func);
+
+ function C_Pbc_Func return C_Pbc_Rec;
+ pragma Import (C, C_Pbc_Func);
+
+, and given that that type t is a C struct corresponding to the two Ada
+types, function C_Func corresponds to a t*-valued C function whereas
+function C_Pbc_Func corresponds to a t-valued C function.
--!corrigendum
Questions? Ask the ACAA Technical Agent