Version 1.7 of ais/ai-00376.txt

Unformatted version of ais/ai-00376.txt version 1.7
Other versions for file ais/ai-00376.txt

!standard B.3 (01/1)          05-03-02 AI95-00376/03
!standard B.3 (02)
!standard 1.2 (8/1)
!class ramification 04-03-08
!status Amendment 200Y 04-07-02
!status WG9 approved 04-11-18
!status ARG Approved 3-0-3 04-06-14
!status work item 04-03-08
!status received 04-03-08
!qualifier Clarification
!priority Medium
!difficulty Easy
!subject Interfaces.C works for C++ as well
!summary
Wording changes are made to the Standard to make clear that the interfacing capabilities of section B.3 apply to the C-subset of C++ as well.
!question
Which provisions does Ada offer to interface with C++ ?
!recommendation
(See wording.)
!wording
Change the title of section B.3 to read "Interfacing with C and C++"
Change B.3(1-2) to read:
The facilities relevant to interfacing with the C language and the corresponding subset of the C++ language are the package Interfaces.C and its children, and support for the Import, Export, and Convention pragmas with convention_identifier C; and support for the Convention pragma with convention_identifier C_Pass_By_Copy.
The package Interfaces.C contains the basic types, constants and subprograms that allow an Ada program to pass scalars and strings to C and C++ functions. When this clause mentions a C entity, the reference also applies to the same entity in C++.
Add the following after 1.2(8/1):
ISO/IEC 14882:2003, Programming languages - C++
!discussion
The facilities provided for C work equally well for C++. Admittedly, a truly convenient interfacing with C++ would also entail interfacing with the object-oriented elements of C++. However, specifying standardized interfaces for this capability in a compiler-independent fashion is deemed too difficult.
Note that if we normatively talk about C++, we need a reference to its standard in 1.2.
!corrigendum 1.2(8/1)
Insert after the paragraph:
ISO/IEC 10646-1:1993, Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane, supplemented by Technical Corrigendum 1:1996.
the new paragraph:
ISO/IEC 14882:2003, Programming languages — C++.
!corrigendum B.3(0)
Replace the paragraph:
Interfacing with C
by:
Interfacing with C and C++
!corrigendum B.3(1/1)
Replace the paragraph:
The facilities relevant to interfacing with the C language are the package Interfaces.C and its children; support for the Import, Export, and Convention pragmas with convention_identifier C; and support for the Convention pragma with convention_identifier C_Pass_By_Copy.
by:
The facilities relevant to interfacing with the C language and the corresponding subset of the C++ language are the package Interfaces.C and its children; support for the Import, Export, and Convention pragmas with convention_identifier C; and support for the Convention pragma with convention_identifier C_Pass_By_Copy.
!corrigendum B.3(2)
Replace the paragraph:
The package Interfaces.C contains the basic types, constants and subprograms that allow an Ada program to pass scalars and strings to C functions.
by:
The package Interfaces.C contains the basic types, constants and subprograms that allow an Ada program to pass scalars and strings to C and C++ functions. When this clause mentions a C entity, the reference also applies to the same entity in C++.
!ACATS test
There is no functional change to the language here, so further tests are not needed.
!appendix

****************************************************************

Questions? Ask the ACAA Technical Agent