CVS difference for ais/ai-00320.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00320.txt

--- ais/ai-00320.txt	2003/01/02 23:58:47	1.1
+++ ais/ai-00320.txt	2003/03/04 04:56:23	1.2
@@ -1,4 +1,4 @@
-!standard  B.1  (49)                                   03-01-02  AI95-00320/01
+!standard  B.1  (49)                                   03-02-18  AI95-00320/02
 !class binding interpretation 03-01-02
 !status work item 03-01-02
 !status received 03-01-02
@@ -36,13 +36,31 @@
 
 Add after B.1(38):
 
-A convention other than the ones defined by the language in subclause 6.3.1
-are known as a foreign convention. The effect of a partition containing an
-interfacing pragma with a foreign convention may differ from that defined by
-this International Standard.
+Conventions other than Ada, Intrinsic, entry, and protected
+are known as foreign conventions. The effect of a partition containing a
+pragma Import, pragma Export, or a pragma Convention with a foreign convention
+may differ from that defined by this International Standard.
 
 !discussion
 
+This wording includes pragma Import and Export for all conventions, including
+Ada. That's necessary as convention only specifies the calling convention,
+while the body of an imported routine (or the caller of an exported routine)
+may be written in any language. And that other language could easily violate
+Ada semantics.
+
+However, we do not want this wording to cover pragma Convention (Ada). If it
+did, a pragma confirming the convention would also allow the compiler to
+violate Ada semantics. We do need to include Convention for foreign
+conventions, as the calling convention may not include the needed support for
+Ada semantics. Imagine an implementation that passes the current innermost
+exception handler in a specific register. The C calling convention would
+most likely not pass or save that register, and thus exceptions could not
+propogate through a C convention call, even if both the caller and called
+routine are written in Ada. This seems like a reasonable implementation;
+thus, we must not require pragma Convention with a foreign convention to
+preserve Ada semantics.
+
 !corrigendum B.1(38)
 
 @dinsa
@@ -51,10 +69,10 @@
 Import does not create the entity. Such an elaboration has no other effect than
 to allow the defining name to denote the external entity.
 @dinst
-A convention other than the ones defined by the language in subclause 6.3.1
-are known as a @i<foreign convention>. The effect of a partition containing an
-interfacing pragma with a foreign convention may differ from that defined by
-this International Standard.
+Conventions other than Ada, Intrinsic, entry, and protected
+are known as @i<foreign conventions>. The effect of a partition containing a
+@fa<pragma> Import, @fa<pragma> Export, or a @fa<pragma> Convention with a
+foreign convention may differ from that defined by this International Standard.
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent