Rationale for Ada 2012

John Barnes
Contents   Index   References   Search   Previous   Next 

9.1.1 Incompatibilities with Ada 2005

Each incompatibility listed below gives the AI concerned and the paragraph in the AARM which in some cases will give more information. Where relevant, the section in this rationale where the topic is discussed is also given. Where appropriate the incompatibilities are grouped together.
Note that this list only covers those incompatibilities that might reasonably occur. There are a number of others which are so unlikely that they do not seem worth mentioning.
1 — The word some is now reserved. Programs using it as an identifier will need to be changed. (AI-176, 2.9)
Adding new reserved words is a very visible incompatibility. Six were added in Ada 95, three in Ada 2005, and now just one in Ada 2012. Perhaps this is the end of the matter. The word some is used in quantified expressions; it already was reserved in SPARK [25] where it is used in quantified expressions in proof contexts.
2 — If a predefined package has additional entities then incompatibilities can arise. Thus suppose the predefined package Ada.Stuff has an additional entity More added to it. Then if an Ada 2005 program has a package P containing an entity More then a program with a use clause for both Ada.Stuff and P will become illegal in Ada 2012 because the reference to More will become ambiguous. This also applies if further overloadings of an existing entity are added.
This can be overcome by adding child packages of course. However, adding lots of child packages can be an inconvenience for the user and so in many cases extending a package seemed more appropriate especially if the identifiers concerned are unlikely to have been used by programmers.
The following packages have been extended with additional entities as listed.
Ada.Characters.Handling

Is_Line_Terminator, Is_Mark, Is_Other_Format, Is_Punctuation_Connector, Is_Space. (AI-185, A.3.2)
Ada.Containers

Capacity_Error. (AI-1, A.18.1)
Ada.Containers.Vectors

Assign, Copy, Constant_ Reference, Constant_Reference_Type, Iterate, Reference, Reference_Type, Vector_Iterator_Interfaces. (AI-1, AI-211, A.18.2)
There are similar additions to the other containers Ada.Containers.Doubly_Linked_Lists etc.
Ada.Directories

Name_Case_Kind, Name_Case_Equivalence. (AI-49, A.16)
Ada.Dispatching

Yield. (AI-166, D.2.1)
Ada.Environment_Variables

Value. (AI-285, A.17)
Ada.Execution_Time

Interrupt_Clocks_Supported, Separate_Interrupt_Clocks_Supported, Clocks_For_Interrupts. (AI-170, D.14)
Ada.Task_Identification

Environment_Task, Activation_Is_Complete. (AI-189, C.7.1)
Ada.Strings.Fixed

Find_Token. (AI-31, A.4.3)
Ada.Strings.Bounded

Find_Token. (AI-31, A.4.4)
Ada.Strings.Unbounded

Find_Token. (AI-31, A.4.5)
There are similar additions to Ada.Strings.Wide_Fixed, Ada.Strings.Wide_Bounded and Ada.Strings.Wide_Unbounded. (AI-31, A.4.7)
Ada.Tags

Is_Abstract. (AI-173, 3.9)
It seems unlikely that existing programs will be affected by these potential incompatibilities.
3 — Membership tests are no longer allowed as a discrete choice. This is explained in detail in Section 3.6 of the chapter on Expressions. (AI-158, 3.8.1)
4 — Allowing functions to have parameters of all modes led to the introduction of stricter rules on aliasing. It is possible that a program that seemed to work in Ada 2005 is illegal in Ada 2012. See Section 4.2 of the chapter on Structure and Visibility. (AI-144, 6.4.1)
5 — Implicit conversion is now allowed from anonymous access types to general access types. Such conversions can make calls ambiguous in the presence of overloading where only one call was permitted in Ada 2005. Consider
type RT is access all T;
function F return RT;
function F return access T;
procedure B(R: RT);
and then the call
B(F);    -- ambiguous in Ada 2012
The call of B is ambiguous in Ada 2012 because the call could be to either function F. But in Ada 2005, the implicit conversion is not possible and so the call has to be to the first function F. (AI-149, 8.6)
6 — It is now illegal to declare a formal abstract subprogram whose controlling type is incomplete. This is related to various improvements to incomplete types described in Section 4.3 of the chapter on Structure and Visibility. (AI-296, 12.6)
7 — The pragma Controlled has been removed from the language. It was never implemented anyway. (AI-229, 13.11.3)
8 — The package Ada.Dispatching was Pure in Ada 2005 but has been downgraded to Preelaborable because of the addition of Yield. This is unlikely to be a problem. (AI-166, D.2.1)

Contents   Index   References   Search   Previous   Next 
© 2011, 2012, 2013 John Barnes Informatics.
Sponsored in part by:
The Ada Resource Association:

    ARA
  AdaCore:


    AdaCore
and   Ada-Europe:

Ada-Europe