CVS difference for ais/ai-00037.txt
--- ais/ai-00037.txt 1998/09/30 00:17:08 1.1
+++ ais/ai-00037.txt 1999/07/09 21:42:06 1.2
@@ -1,6 +1,7 @@
-!standard B.3 (20) 97-03-19 AI95-00037/06
+!standard B.3 (20) 99-07-09 AI95-00037/07
!standard B.3 (31)
!class binding interpretation 96-02-06
+!status Corrigendum 2000 99-05-24
!status WG9 approved 96-12-07
!status ARG approved 12-0-0 96-10-07
!status ARG approved 8-0-0 (subject to editorial review) 96-06-17
@@ -10,7 +11,7 @@
!difficulty Medium
!subject In Interfaces.C, nul and wide_nul represent zero
-!summary 95-06-25
+!summary
In package Interfaces.C, the type wchar_t is a discrete type.
The constants nul and wide_nul have implementation defined
@@ -18,7 +19,7 @@
Types char and wchar_t may use a signed or unsigned
representation.
-!question 96-09-15
+!question
The following declarations appear in Interfaces.C:
@@ -42,11 +43,11 @@
Are the constants nul and wide_nul intended to be represented as
zero? (Yes.)
-!recommendation 95-06-25
+!recommendation
(See summary.)
-!wording 96-07-23
+!wording
Modify paragraphs (19,20,30,31) as follows:
@@ -62,7 +63,7 @@
The constants nul and wide_nul should have a representation of zero.
-!discussion 96-04-04
+!discussion
The intent is that wchar_t be discrete.
@@ -80,8 +81,40 @@
It is important to allow signed representations of char and wchar_t,
in order to properly match what the C implementation does.
+
+!corrigendum B.03(20)
+
+@drepl
+@xcode<nul : @b<constant> char := char'First;>
+@dby
+@xcode<nul : @b<constant> char := @i<@ft<implementation-defined>>;>
+
+!corrigendum B.03(30)
+
+@drepl
+@xcode<@b<type> wchar_t @b<is> @i<@ft<implementation-defined>>;>
+@dby
+@xcode<@b<type> wchar_t @b<is> @i<@ft<<implementation-defined discrete type@>>>;>
+
+!corrigendum B.03(31)
+
+@drepl
+@xcode<wide_nul : @b<constant> wchar_t := wchar_t'First;>
+@dby
+@xcode<wide_nul : @b<constant> wchar_t := @i<@ft<implementation-defined>>;>
+
+!corrigendum B.03(63)
+
+@dinsb
+The constants nul and wide_nul should have a representation of zero.
+
+!ACATS test
+
+Implementation advice is not testable, since an implementation is free to
+ignore it. While a C-Test could be written to verify that char and wchar_t
+are discrete types, this would have little value.
-!appendix 97-03-19
+!appendix
!section B.3(31)
!subject Can wchar_t be signed?
@@ -136,22 +169,22 @@
wide_nul : constant wchar_t := wchar_t'first;
The intent of the Interfaces.C is to give an Ada representation of the C
-types. With the definition of nul as the wchar_t'first, additional
-semantics which do not exist in C are added.
+types. With the definition of nul as the wchar_t'first, additional
+semantics which do not exist in C are added.
The following is one example where the added restriction is harmful.
There may be others.
We have an C implementation were wide_char is signed, and we also
have a C header file, defining some character values to
-positive and negative values.
+positive and negative values.
-Automatic translation of this header file to Ada will not work.
+Automatic translation of this header file to Ada will not work.
The above problem is of course not a major one, but as there is no
argument presented except "not harmful" for the other view, it seems
-much better stay with the original intent, to mimic the C definition
-as closely as possible.
+much better stay with the original intent, to mimic the C definition
+as closely as possible.
Also, most other constants in this package are implementation defined
Questions? Ask the ACAA Technical Agent