CVS difference for ai12s/ai12-0219-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai12s/ai12-0219-1.txt

--- ai12s/ai12-0219-1.txt	2017/04/08 00:47:53	1.1
+++ ai12s/ai12-0219-1.txt	2017/07/22 02:29:48	1.2
@@ -1,7 +1,9 @@
-!standard B.1(38.1/3)                                    17-04-07  AI12-0219-1/01
+!standard B.1(38.1/3)                                    17-07-21  AI12-0219-1/02
 !standard B.3(69/2)
 !standard B.3(70)
 !class binding interpretation 17-04-07
+!status Amendment 1-2012 17-07-21
+!status ARG Approved 8-0-1  17-06-16
 !status work item 17-04-07
 !status received 16-12-22
 !priority Low
@@ -31,54 +33,63 @@
 aspects does not violate Ada semantics; otherwise, program execution is
 erroneous.{ For example, passing an object with mode in to imported code that
 modifies it causes erroneous execution. Similarly, calling an imported subprogram
-that does is not pure from a pure package causes erroneous execution.}
+that is not pure from a pure package causes erroneous execution.}
 
 Modify B.3(69/2):
 
-* An Ada parameter of a record type T, of any mode, other than an in parameter
-  of a type of convention C_Pass_By_Copy, is passed as a t* argument to a C
-  function, where t is the C struct corresponding to the Ada type T.{ In the
-  case of an Ada parameter of mode in, use of the const modifier (that is,
-  const t*) is recommended.}
+* An Ada parameter of a record type T, [of any mode,] other than an in
+  parameter of a type of convention C_Pass_By_Copy, is passed as a t*
+  argument to a C function{, with the const modifier if the Ada mode is in},
+  where t is the C struct corresponding to the Ada type T.
 
 Modify B.3(70):
 
-* An Ada parameter of an array type with component type T, of any mode, is
-  passed as a t* argument to a C function, where t is the C type
-  corresponding to the Ada type T.{  In the case of an Ada parameter of
-  mode in, use of the const modifier (that is, const t*) is recommended.}
-
-[Editor's note: I'd prefer breaking the above into 4 bullets, because these are
-defining "correspondences", not specifically how imported C code should be written.
-Most C code isn't under control of the Ada programmer anyway, so its unclear who
-that recommendation is for anyway. My suggestion:
-
-Replace B.3(69/2) with:
-
-* An Ada in parameter of a record type T, where T does not have convention C_Pass_By_Copy,
-  is passed as a const t* argument to a C function, where t is the C struct corresponding
-  to the Ada type T. This is equivalent to a t* argument if the C code does not modify the
-  argument; otherwise execution may be erroneous (see B.1).
-* An Ada parameter of a record type T, other than a parameter of mod in, is passed as a t*
-  argument to a C function, where t is the C struct corresponding to the Ada type T.
-
-Replace B.3(70) with:
-
-* An Ada in parameter of an array type with component type T is passed as a const t* argument
-  to a C function, where t is the C type corresponding to the Ada type T. This is equivalent
-  to a t* argument if the C code does not modify the argument; otherwise execution may be
-  erroneous (see B.1).
-* An Ada parameter of an array type with component type T, of any mode other than mode in, is passed
-  as a t* argument to a C function, where t is the C type corresponding to the Ada type T.
+* An Ada parameter of an array type with component type T[, of any mode,]
+  is passed as a t* argument to a C function{, with the const modifier if
+  the Ada mode is in}, where t is the C type corresponding to the Ada type T.
 
-End Editor's note.]
-
 !discussion
 
 We add some examples to B.1(38.1/3) to try to illustrate what it is talking
 about. This is a very important rule to implementers, as it constrains what
 an interfaced routine can do. Users need to be aware of the consequences.
 
+!corrigendum B.1(38.1/3)
+
+@drepl
+It is the programmer's responsibility to ensure that the use of interfacing
+aspects does not violate Ada semantics; otherwise, program execution is
+erroneous.
+@dby
+It is the programmer's responsibility to ensure that the use of interfacing
+aspects does not violate Ada semantics; otherwise, program execution is
+erroneous. For example, passing an object with mode @b<in> to imported code that
+modifies it causes erroneous execution. Similarly, calling an imported subprogram
+that is not pure from a pure package causes erroneous execution.
+
+!corrigendum B.3(69/2)
+
+@drepl
+@xbullet<An Ada parameter of a record type T, of any mode, other than an
+@b<in> parameter of a type of convention C_Pass_By_Copy, is passed as a t*
+argument to a C function, where t is the C struct corresponding to the Ada
+type T.>
+@dby
+@xbullet<An Ada parameter of a record type T, other than an
+@b<in> parameter of a type of convention C_Pass_By_Copy, is passed as a t*
+argument to a C function, with the const modifier if the Ada mode is @b<in>,
+where t is the C struct corresponding to the Ada type T.>
+
+!corrigendum B.3(70)
+
+@drepl
+@xbullet<An Ada parameter of an array type with component type T, of any mode,
+is passed as a t* argument to a C function, where t is the C type corresponding
+to the Ada type T.>
+@dby
+@xbullet<An Ada parameter of an array type with component type T is passed as a
+t* argument to a C function, with the const modifier if
+the Ada mode is @b<in>, where t is the C type corresponding to the Ada type T.>
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent