Development Log in categories Ada / Ada 2005 / Ada 2012 and Ada
-
Ada Basics Training Course in Paris Offices
AdaCore is organizing a public training from June 17th to June 21st, on Ada basics. This training targets people that have programming knowledge in languages such as Java, C or C++, but with little or no Ada knowledge. It is particularly appropriate for programmers that have just joined an Ada project, or are planning to in the next 12 months.
This training combines theory and practice. The practical exercises are carried out on a GNAT Pro installation. The following topics will be studied:
- Programming structures (declarations, types, instructions, arrays, record, exceptions)
- Software architecture (subprograms, packages, encapsulation, access types, inheritance, limited types, genericity)
- Ada 2012 Overview of advanced concepts (object orientation, low level programming, concurrency)
Please contact info@adacore.com for additional information. -
AI-285 New function Value with default
A new function Value is added to package Ada.Environment_Variables:function Value (Name : in String; Default : in String) return String;
if the external execution environment supports environment variables and an environment variable with the given name currently exists, then Value returns its value; otherwise, it returns Default. -
AI-0272 Restrictions No_Use_Of_Pragma and others
Restrictions No_Use_Of_Pragma and No_Use_Of_Attributes are now recognized. -
AI-0290 Extensions to Assertion_Policy control
Assertion_Policy as now implemented in extended form. The main improvements are that it can appear in any declarative part with scope rules like pragma Suppress, and it can be applied to individual assertion aspects. GNAT extensions allow it to also apply to GNAT assertion aspects and pragmas. Check_Policy is enhanced in a consistent manner. Finally Debug pragmas are now controllable with Assertion_Policy. -
AI-0054 A raise expression does not fail for IN
If a predicate contains a raise expression, and this raise is evaluated as part of an IN membership test, then the result is simply that the membership test fails. The exception is not raised. -
AI-0022 Raise expressions
An expression can contain a raise expression. This is a new kind of relation which has the form "raise exception_NAME [with string_EXPRESSION]. The effect is to raise the given exception. This is particularly useful in the context of assertions such as preconditions, where it can be used to specify the exception that is raised if the assertion fails. -
AI-421 Sequential activation and attachment
The Sequential partition elaboration policy is supported for restricted (Ravenscar) runtimes. When this policy is used, tasks activation and interrupt handlers attachment is deferred until all library units are elaborated. -
AI-265 Partition elaboration policy
The pragma Partition_Elaboration_Policy specifies the elaboration policy for a partition. The default policy is Concurrent. -
Ada 2012 Rationale - Chapter 1 - Contracts and Aspects
Read the latest installment of the Ada 2012 Rational by John Barnes:
Download Chapter 1 - Contracts and Aspects -
Ada Connection 2011 - Real-Time Management & Production Systems for Manufacturing and Energy Facilit
Here's this Monday's installment from the Ada Connection 2011 talks. Jozef Cvirik from Ipesoft gives a talk on Real-Time Management & Production Systems for Manufacturing and Energy Facilities
A new film added every Monday. To view all the films we've added to date, please visit the Ada Lecture Series.
-
Ada 2012 Rationale - Chapter 1 - Contracts and Aspects
Read the latest installment of the Ada 2012 Rational by John Barnes:
Download Chapter 1 - Contracts and AspectsAda Connection 2011 - Assuring Software Reliability While Using Web Services and Commercial Products
Here's this Monday's installment from the Ada Connection 2011 talks. Jeff O’Leary from the Federal Aviation Administration gives a talk on Assuring Software Reliability While Using Web Services and Commercial Products
A new film added every Monday. To view all the films we've added to date, please visit the Ada Lecture Series.
AI-0232 Hole in AI05-0067, build-in-place rules
Function calls returning limited types work properly (without a copy, what the Ada RM calls "built in place") even in cases where the limitedness is not known at compile time because the function returns the class-wide type of an interface type. GNAT has always implemented this correctly.AI-0222 Primitive subp completion ok post-freezing
This AI confirms that the existing behavior of the GNAT compiler is correct in not treating the completion of a subprogram as a declaration for purposes of checking the rule prohibiting the declaration of a primitive operation of a tagged type after the type has been frozen.AI-0220 Needed components for aggregates
This AI addresses a wording problem in the RM that appears to permit some complex cases of aggregates with non-static discriminants. GNAT has always implemented the intended semantics.AI-0216 No_Task_Hierarchy forbids local tasks
It is clearly the intention that No_Task_Hierarchy is intended to forbid tasks declared locally within subprograms, or functions returning task objects, and that is the implementation that GNAT has always provided. However the language in the RM was not sufficiently clear on this point. Thus this is a docmentation change in the RM only.AI-0210 Correct Timing_Events metric
This is a documentation only issue regarding wording of metric requirements, that does not affect the implementation of the compiler.AI-0208 Characteristics of incomplete views
The wording in the Ada 2005 RM concerning characteristics of incomplete views was incorrect and implied that some programs intended to be legal were now illegal. GNAT had never considered such programs illegal, so it has always implemented the intent of this AI.AI-0207 Mode conformance and access constant
This AI confirms that access_to_constant indication must match for mode conformance. This was implemented in GNAT when the qualifier was originally introduced in Ada 2005.AI-0205 Extended return declares visible name
This AI corrects a simple omission in the RM. Return objects have always been visible within an extended return statement.AI-0203 Extended return cannot be abstract
A return_subtype_indication cannot denote an abstract subtype. GNAT has never permitted such usage.AI-0200 Mismatches in formal package declarations
This AI plugs a gap in the RM which appeared to allow some obviously intended illegal instantiations. GNAT has never allowed these instantiations.AI-0198 Inheriting abstract operators
This AI resolves a conflict between two rules involving inherited abstract operations and predefined operators. If a derived numeric type inherits an abstract operator, it overrides the predefined one. This interpretation was always the one implemented in GNAT.AI-0196 Null exclusion tests for out parameters
Null exclusion checks are not made for OUT parameters when evaluating the actual parameters. GNAT has never generated these checks.AI-0194 Value of Stream_Size attribute
The Stream_Size attribute returns the default number of bits in the stream representation of the given type. This value is not affected by the presence of stream subprogram attributes for the type. GNAT has always implemented this interpretation.AI-0182 Additional forms for Character’Value
This AI allows Character'Value to accept the string '?' where ? is any character including non-graphic control characters. GNAT has always accepted such strings. It also allows strings such as HEX_00000041 to be accepted, but GNAT does not take advantage of this permission and raises constraint error, as is certainly still permitted.AI-0178 Incomplete views are limited
This AI clarifies the role of incomplete views and plugs an omission in the RM. GNAT always restricted correctly the use of incomplete views and types.AI-0155 Size clause on type with non-static bounds
This AI clarifies the legality rules for size clauses on elementary subtypes whose bounds are non-static. GNAT has always followed what is now a precise implementation permission, namely that an implementation is allowed to assume the worst when computing the size of such a subtype.AI-0134 Profiles must match for full conformance
For full conformance, the profiles of anonymous-access-to-subprogram parameters must match. GNAT has always enforced this rule.AI-0133 Extending a type with self-reference
This AI discusses the legality of extending a record type when one of its components has a self-referencing discriminant constraint. GNAT has always treated such an extension as legal.AI-0132 Placement of library unit pragmas
This AI fills a gap in the description of library unit pragmas. The pragma clearly must apply to a library unit, even if it does not carry the name of the enclosing unit. GNAT has always enforced the required check.AI-0129 Limited views and incomplete types
This AI clarifies the description of limited views: a limited view of a package includes only one view of a type that has an incomplete declaration and a full declaration (there is no possible ambiguity in a client package). This AI also fixes an omission: a nested package in the private part has no limited view. GNAT always implemented this correctly.AI-0128 Inequality is a primitive operation
If an equality operator ("=") is declared for a type, then the implicitly declared inequality operator ("/=") is a primitive operation of the type. This is the only reasonable interpretation, and is the one always implemented by GNAT, but the RM was not entirely clear in making this point.AI-0126 Dispatching with no declared operation
This AI clarifies dispatching rules, and simply confirms that dispatching executes the operation of the parent type when there is no explicitly or implicitly declared operation for the descendant type. This has always been the case in all versions of GNAT.AI-0122 Private with and children of generics
This AI clarifies the visibility of private children of generic units within instantiations of a parent. GNAT has always handled this correctly.AI-0120 Constant instance of protected object
This is an RM editorial change only. The section that lists objects that are constant failed to include the current instance of a protected object within a protected function. This has always been treated as a constant in GNAT.AI-0119 Effects of daylight saving on Time ops
All routines in Ada.Calendar and routine UTC_Time_Offset in Ada.Calendar. Time_Zones have implementation-defined behavior when a time-zone change such as daylight saving in the United States occurs.AI-0118 The association of parameter associations
This AI clarifies the rules for named associations in subprogram calls and generic instantiations. The rules have been in place since Ada 83.AI-0117 Memory barriers and volatile objects
This AI modifies the implementation advice for pragma Volatile to avoid some unintended overspecification. GNAT has always ignored the incorrect language in the standard.AI-0116 Alignment of class-wide objects
This AI requires that the alignment of a class-wide object be no greater than the alignment of any type in the class. GNAT has always followed this recommendation.AI-0114 Classification of letters
The code points 170 (FEMININE ORDINAL INDICATOR), 181 (MICRO SIGN), and 186 (MASCULINE ORDINAL INDICATOR) are technically considered lower case letters by Unicode. However, they are not allowed in identifiers, and they return False to Ada.Characters.Handling.Is_Letter/Is_lower. This behavior is consistent with that defined in Ada 95.AI-0109 Redundant check in S’Class’Input
This AI is an editorial change only. It removes the need for a tag check that can never fail.AI-0108 Limited incomplete view and discriminants
This AI confirms that an incomplete type from a limited view does not have discriminants. This has always been the case in GNAT.AI-0107 A failed allocator need not leak memory
The RM used to mistakenly imply that a failed allocator must leak memory. This AI gives the implementation permission for (but does not require) avoiding this memory leak. This does not require any implementation change.AI-0106 No rep pragmas on generic formals
The RM appears to allow representation pragmas on generic formals, but this was not intended, and GNAT has never permitted this usage.AI-0102 Some implicit conversions are illegal
It is illegal to assign an anonymous access constant to an anonymous access variable. The RM did not have a clear rule to prevent this, but GNAT has always generated an error for this usage.AI-0099 Tag determines whether finalization needed
This AI clarifies that "needs finalization" is part of dynamic semantics, and therefore depends on the run-time charateristics of an object (i.e. its tag) and not on its nominal type. As the AI indicates: "we do not expect this to affect any implementation".AI-0098 Anonymous subprogram access restrictions
An unintentional omission in the RM implied some inconsistent restrictions on the use of anonymous access to subprogram values. These restrictions were not intentional, and have never been enforced by GNAT.AI-0095 Address of intrinsic subprograms
The prefix of 'Address cannot statically denote a subprogram with convention Intrinsic. The use of the Address attribute raises Program_Error if the prefix denotes a subprogram with convention Intrinsic.