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

Differences between 1.4 and version 1.5
Log of other versions for file ai12s/ai12-0135-1.txt

--- ai12s/ai12-0135-1.txt	2015/01/31 01:45:26	1.4
+++ ai12s/ai12-0135-1.txt	2015/02/25 23:02:19	1.5
@@ -1,5 +1,6 @@
-!standard B.1(14/3)                             15-01-26   AI12-0135-1/02
+!standard B.1(14/3)                             15-02-25   AI12-0135-1/03
 !standard B.1(41/3)
+!standard B.3(65/3)
 !class Amendment 14-10-09
 !status work item 14-10-09
 !status work item 15-01-26
@@ -12,6 +13,8 @@
 
 Enumeration types are eligible for all languages that interface with
 Ada, subject to a limitation on their range of internal codes.
+More detailed requirements exist for mapping Ada enumeration types to C/C++
+enum types.
 
 !problem
 
@@ -25,6 +28,7 @@
 
 Require support for interfacing with Ada enumeration types, so long as
 the number of internal codes is within some implementation defined range.
+Impose more detailed requirements for C/C++.
 
 !wording
 
@@ -32,14 +36,20 @@
 
   * T is an enumeration type such that all internal codes (whether assigned
     by default or explicitly) are within an implementation-defined range
-    that includes at least the range of values 0 .. 2**16-1;
+    that includes at least the range of values 0 .. 2**15-1;
 
 Modify the last sentence of B.1(41/3):
 
   Specifying the Convention aspect need not be supported for scalar
   types{, other than enumeration types whose internal codes fall within
-  the range 0 .. 2**16-1}.
+  the range 0 .. 2**15-1}.
 
+Add after B.3(65):
+
+  * An Ada enumeration type corresponds to a C enumeration type with the
+    same enumeration literals having the same internal codes, provided the
+    internal codes fall within the range of the C int type.
+
 !discussion
 
 For some reason, B.1(12-21/3) do not require any scalar types to be
@@ -52,6 +62,16 @@
 require support for enumeration types in all languages that interface
 with Ada, subject to an implementation-defined limitation on the range
 of internal codes.
+
+We set the minimum supported range to be the non-negative values of the
+16-bit signed integer type, since that is known to be supportable by C
+compilers, and is presumed to be supportable by any other language which
+supports integer types.
+
+For C, we require that an Ada enumeration type maps to a C enumeration type,
+provided the internal codes fall within the range of "int," as that is
+the C requirement.  C++ is more flexible, but there seems no reason to specify
+additional requirements for C++ interfacing.
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent