- Ada 2012
- Ada 2005 / 95 / 83
- Embedded Development
- Formal Methods
- Open Source
- Safety-Critical Development
- Static Analysis
Jan 20th, 2005
Multiple signals supported on Windows
On Windows an application can now recover from multiple signals. This enhancement is supported on both exception models (setjump/longjump and Zero-Cost). The new signal handling implementation is based on the structured exception handling facility in Windows.
Jan 18th, 2005
Pragma Obsolescent for library subprograms
Pragma Obsolescent previously could only be used for a subprogram declared within another declarative region, e.g. within a package. Now this pragma can also be used for library subprograms.
Initialize_Scalars chooses better values
Initialize_Scalars cannot do quite as good a job as Normalize_Scalars in choosing invalid values, since the values have to be supplied at bind time when less information is available, but improvements have been made to get invalid values in more cases. In particular unsigned subtypes of signed types now give invalid values where possible.
Normalize_Scalars chooses better values
Normalize_Scalars now is able to select guaranteed invalid values in more cases than was the case previously (see new documentation in GNAT reference manual for full details).
Jan 13th, 2005
Flag use of Ada 2005 reserved words
In Ada-95 mode, the use of "interface", "overriding", and "synchronized" as an identifier generates a warning that the identifier will become reserved in Ada 2005 (and thus be illegal).
AI-311 Static match of scalar formal subtypes
Ada 2005 fixes the definition of statically matching constraints. A constraint "statically matches" another constraint if: 1) both are null constraints; 2) both are static and have equal corresponding bounds or discriminant values; 3) both are nonstatic and result from the same elaboration of a constraint of a subtype_indication or the same evaluation of a range of a discrete subtype definition>; or 4) both are nonstatic and both come from the same formal type declaration
AI-284 New reserved words
Use of the identifiers "interface", "overriding", or "synchronized" is not permitted, since these are new reserved words in Ada 2005.
Jan 12th, 2005
Default exit/return code qualifier
The new GNAT BIND qualifier /RETURN_CODES=VMS is now available for setting the default exit status/return code to success. Must be used in conjunction with the GNAT LINK qualifier of the same name.
AI-306 Class-wide extension aggregate expression
This AI fixes the following language rule: "If the ancestor part of an aggregate is an expression, the expression must not be dynamically tagged."
Jan 10th, 2005
Facilities for setting close-on-exec flag
A new subprogram Set_Close_On_Exec has been added to GNAT.OS_Lib. It allows setting the close-on-exec flag on an open file descriptor.
AI-239 Inherited default expressions
When a primitive subprogram of a tagged type is inherited, a default expression given by tag-indeterminate function call is treated as if the default expression is of the derived type. This means that when a subprogram call is made to the derived subprogram using the default, it will effectively dispatch and invoke the corresponding primitive function of the derived type.
Jan 7th, 2005
Finalization code has been optimized for tasking programs that do not make any use of the asynchronous transfert of controls (abort). This optimization is especially effective on platforms where access to task specific data is not optimized at the system level.
AI-270 Stream_Size attribute
The Stream_Size attribute can be used to control the size of the elementary type object written into stream. This is significant because different compilers can choose a different base type for the same type definition. This makes Ada programs more interoperable by giving the ability to control precisely external representation of stream objects.
Jan 4th, 2005
Default _APP_GET_TIME in AAMP library
For the AAMP target only, there is now a default dummy version of the function _APP_GET_TIME, defined in the AAMP run-time library package Mini_RTE.Clock and linked in to all programs. Formerly it was required that applications provide an implementation of _APP_GET_TIME in order to use the Calendar package; otherwise an unresolved reference would be reported by CLINK.
AI-0054 Variable views of constant objects
The practice of obtaining a variable aliased view to modify an object during initialization is an existing idiom that is now explicitly allowed even if the object is declared constant.
AI-436 Record representation for limited records
This AI allows the use of record represenation clauses for limited record types. GNAT has always permitted this usage.
AI-432 Out of range values in Ada.Real_Time
This AI ensures proper range checks when converting between Duration values and values of Ada.Real_Time. In all standard versions of GNAT Pro, these types have the same range, so there are no out of range values to consider.
AI-431 Remote access-to-subprogram conversions
This AI forbids all conversions between remote access-to-subprogram and local access-to-subprogrmam types. This was already implemented in GNAT and was actually tested by ACATS test BXE2011; the AI merely closed a gap in the language by explicitly adding a missing clause to prohibit the conversion of a local access-to-subprogram value to a remote access-to- subprogram type.
AI-426 Abnormal and invalid values from conversion
This AI requires that Unchecked_Conversion never generate abnormal values for scalars. Invalid values can be generated. The point is that it is always safe to use 'Valid to test the validity of such results. This has always been the case in GNAT.
AI-409 Resolution for anonymous access types
This AI specifies matching rules for anonymous access to subprogram types. Overload resolution is based on type conformannce, while legality rules require mode or subtype conformance, depending on the context.
AI-408 Visibility of attribute definition clauses
This AI corrects some mistakes in the RM concerning visibility of attribute definition clauses. Basically the change is to make the RM reflect the obvious intended rule, which has always been implemented in GNAT.
AI-373 Order of record component initialization
This AI defines the order of initialization of record components in certain cases that could have caused undefined discriminants and access values without these ordering requirements. GNAT has always implemented the order required by this AI.
AI-321 Definition of dispatching policies
This AI is a documentation change only. As noted in the text of the AI, it does not change any Ada 95 semantics, so does not affect the implementation.
AI-312 Library level visibility generic children
This AI corrects a small gap in the visibility rules for context clauses. Wording in RM95 makes a reference to Par.Child illegal in a context clause or in a pragma that appears as a compilation unit, if Par.Child is a generic child unit, because Par is not a legal prefix for an expanded name. The AI simply indicates that this reference is in fact legal. GNAT always treated such references correctly.
AI-309 Formal param usable only once
This AI ensures that it is illegal to mention the same formal parameter of a generic twice, or to omit formals that do not have default values. These obvious rules apply in both Ada 95 and Ada 2005, and have always been implemented in GNAT.
AI-279 Tag read by T’Class’Input
If Internal_Tag is applied to a tagged type that is not yet frozen, then a Tag_Error exception is raised. The AI also covers some other cases of bad usage of Internal_Tag, all of which are fully implemented by GNAT.
AI-272 Slices of atomic arrays
This AI notes that, despite the fact that a strict reading of the RM says otherwise, slices of atomic arrays are not necessarily atomic (e.g. an array of four characters can be declared atomic, but that does not mean a slice of 3 characters of this array can be treated atomically). GNAT has always taken this viewpoint.
AI-259 Atomic/Volatile accesses cannot be combined
This AI adds implementation advice requiring that atomic and volatile accesses not be combined, that volatile accesses load or store only the bits of the object, and that atomic accesses generate a single instruction. GNAT has always followed this advice.
AI-257 Restrictions for implementation entities
This AI adds the new restrictions No_Implementation_Attributes and No_Implementation_Pragmas, preventing the use of implementation defined attributes and pragmas. These were copied from GNAT, and have always been been implemented in GNAT.
AI-243 Status of subunit of a subunit
A subunit of a subunit of L is also defined to be subunit of L (this was previously unclear in the RM). This applies to both Ada 95 and Ada 2005, and affects the legality of some cases of withing private units from sub-units. GNAT has always implemented this.
AI-235 Resolution of ‘Access
The prefix type of 'Access (and 'Unchecked_Access) can be used to resolve the expected access type.
AI-224 Pragma Unsuppress
This pragma has been implemented for a long time in GNAT. It undoes the effect of a previous pragma Suppress, or compiler switch suppressing checks (-gnatp).
AI-220 Subprograms withing private units
A subprogram body without a distinct subprogram declaration is considered a declaration (and not a body) for the purposes of checking 10.1.2(8).
AI-147 Optimization of controlled types
This AI specifies the context in which it is legal to eliminate certain calls to Initialize, Adjust and Finalize. In particular, temporary anonymous objects may not require the execution of calls to Initialize/Finalize pairs unless Initialize is user-defined.