Development Log
-
Improved warnings for use of Address aspect
For an address attribute definition clause, there is a warning if a smaller item is overlaid with a larger one, and the warning about possible lack of reference to the entity is suppressed (on the grounds that aliasing may well be occurring). The same warning improvements are now implemented for the address aspect. -
Improved indentation of conditional expressions
Ada 2012 If-expressions and case-expressions are better handled by the indentation engine and in particular extra indentation levels are used for each case branch. -
WB: Debug tooltip
When debugging an ada application, if the mouse cursor is over a variable that can be printed by the debugger, the tooltip displays the variable current value. This feature requires WRWB 3.3 or later. -
Macros in configuration file
A macro expansion system is now provided for PolyORB runtime configuration parameters, when PolyORB is compiled with GNATCOLL. -
GB: warning editing files not part of a GB project
When the Ada editor opens a file not part of a GNATbench project, a dialog is displayed to inform the user that some features will not work properly until the file is part of a GNATbench project. This dialog can be disabled through Ada Editor Preferences page. -
Use host name instead of IP address in CORBA IORs
IIOP listening endpoint addresses can now be specified to be published by host name (rather than by IP address) in IORs. -
More accurate warnings for generic bodies
Warnings on generic bodies (e.g. for suspicious unchecked conversions) are now properly controlled by the setting of warning flags at the point of instantiation (rather than the settings in effect when the instance bodies are analyzed. This allows finer control over warnings from generic bodies. -
To_Address attribute can handle high addresses
Previously, if the argument of To_Address was given as a literal or other untyped static expression, the argument of To_Address could be no greater than 2**63-1 even on 64-bit machines where addresses up to 2**64-1 make sense. This attribute now handles static address values up to 2**m-1, where m is the memory size (typically 32 or 64). -
Better messages for Ada 2012 feature not allowed
When an Ada 2012 feature is used, and some other Ada mode is active, then the error message (which used to always advise using the -gnat2012 switch) will now point to the relevant pragma if the incompatible mode was set by the use of a pragma. -
GNAT tools recognize—help and—version switches
All gnat utilities (gnatkr, gnatls, gnatpp, etc) now recognize the --help switch (to output usage information), and --version (to output version and copyright information). -
Warn on ineffective use of -gnateE
Some run times (those that do not support full exception semantics) are unable to implement the extra exception information option set by the use of the -gnateE switch. A warning is now issued if -gnateE is used on such a configuration. -
Switches -gnatc and -gnatR cannot be used together
Output of representation information (-gnatR) requires code to be generated, so this switch is incompatible with the use of -gnatc. This prohibition is now documented in the users guide and checked by the compiler. -
Add For_Each and Sort_Table to GNAT.Table
Procedures For_Each and Sort_Table have been added to GNAT.Table to make the interface closer to that of GNAT.Dynamic_Tables. -
Switch -gnatRm to dump convention/mechanisms
The switch -gnatRm (/REPRESENTATION_INFO=MECHANISMS in VMS) causes the convention and parameter passing mechanisms to be listed for all subprograms. Note: this is actually not a new feature, it was added some time ago, but never got documented until now, so that is why it appears in this version of the features file. -
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. -
New attribute Restriction_Set
This attribute allows compile testing of whether a restriction is set. The allowed restrictions that can be tested are No_Dependence, and all boolean (no parameter) restrictions for which the binder enforces consistency. This is primarily intended for specialization of library code, but can be used in applications programs as well. -
Improved error message for illegal trigger
The error message for an illegal triggering statement in an asynchronous transfer of control now has an RM reference to clarify the legality rule. -
GB: Ada elements now displayed in Properties view
When any element contributed to the Project Explorer or Outline view by GNATbench is selected, you will now see properties of that element in the Properties view. -
Partition_Elaboration_Policy pragma in System
A pragma Partition_Elaboration_Policy pragma may now appear in package System (in file system.ads), to set an elaboration policy for a library (and any program using this library. -
Restriction SPARK_05 replaces SPARK
The restriction SPARK is replaced by SPARK_05 (since this restriction is specifically about violating rules of SPARK 2005). The restriction SPARK is retained for backward compatibility, but will generate a warning that it is obsolescent if it is used. -
Implicit packing for multi-dimensional arrays
The Implicit_Packing pragma now applies to multi-dimensional packed arrays. Previously it was only applicable to single-dimensioned arrays. -
X’Img can be renamed as function
In analogy with the 'Image attribute, the GNAT attribute 'Img can be renamed as a function, and used as an actual for a formal subprogram in an instance. -
Removal of most soft preconditions
CodePeer used to generate "soft" preconditions to guard against errors that may occur only on some paths through a subprogram, but not all paths. This led to false positives in the callers, as well as some imprecise results. Most of these soft preconditions have now been suppressed. Instead, CodePeer relies on the mechanism of conditional preconditions, which states exactly on which paths the guard is needed, and on the assumptions that all computed inputs of the subprogram should be initialized at subprogram call (which leads to precondition checks for initialization at call sites). -
Unchecked_Union types with multiple discriminants
Unchecked_Union record types can now have multiple discriminants with nested variants controlled by different discriminants. -
Allow comments to line up with previous line
An additional allowed indentation for comments when style checking for comments is enabled allows a comment that lines up with the previous non-blank source line. -
gprinstall now supports cross-environment
gprinstall will work in cross-environment by using the newly added --target option. This way it is possible to install a .dll created from a Windows cross-compiler on GNU/Linux for example. -
New aspect and pragma Contract_Cases
A new implementation-defined aspect Contract_Cases and corresponding pragma are now available. This is considered to be an assertion that is controllable using Assertion_Policy or Check_Policy. It is a form of exteded precondition and postcondition testing in which several cases are presented each with a corresponding consequence, and as a postcondition, the consequence that corresponded to the case that was true on entry must hold on exit. For example: Contract_Cases => (P => Q, R => S) means that on entry either P or R must be true (but not both), and on exit, Q must be true if P was true on entry, and S must be true if R was true on entry. -
Recognize variables initialized at declaration
CodePeer avoids issuing messages about uninitialized variables in cases where the variables are known to be fully initialized at the point of their declaration, either by an explicit expression or implicitly due to default initialization. -
Ada 2012 mode enabled by default
The compiler now defaults to the current Ada standard (Ada 2012) instead of Ada 95, which was the historical default. This is basically equivalent to specifying the -gnat2012 switch. You can override this default setting via e.g. -gnat95/-gnat2005 switches or pragma Ada_95/Ada_2005 if needed. Note that Ada 2012 is generally upwards compatible with Ada 95 and Ada 2005, so even if your program is in one of these older versions, it will typically compile in Ada 2012 mode without needing one of these special switches. -
Add Reason parameter for pragma Warnings
All forms of the pragma Warnings now allow an optional extra argument (Reason => static_string_EXPRESSION) that is intended for documenting the purpose of a Warnings pragma. The compiler checks that the argument is a static string expression, but otherwise ignores it. The string is left in the tree, so other tools (e.g. ASIS tools) can read the reason string and possibly provide specialized processing for it. -
GB: Show Ada content in Project Explorer view
GNATbench now uses the Project Explorer view rather than the now deprecated GNAT Project Explorer view. This is the standard view in Eclipse for viewing projects, folders, files, etc. There's also a new view filter that can hide any folders/files that are not relevant to the current build configuration. Working sets are supported now as well. -
GNATCOLL.Traces display microseconds precision
When the stream DEBUG.MICRO_TIME is actived, the time displayed by DEBUG.ABSOLUTE_TIME will show microseconds, instead of just milliseconds by default. -
New attribute Loop_Entry
A new attribute Loop_Entry is available. This can be used only within a Loop_Variant or Loop_Invariant pragma to refer to the value of an expression on entry to the loop. -
Cross-building GNATCOLL
Using 'configure --target=...' can now be used to build GNATCOLL for a cross-target. The --target will be passed as is to gprbuild. -
New attribute Update
A new attribute Update is available. This allows creation of copies of array and record values with specified components modified. The components to be modified are specified by using an argument to the attribute consisting of an aggregate (with no others choice) that specifies the components that are to be modified (e.g. R'Update((2 => 4)) creates a copy of the array value R which is unchanged except that element 2 is changed to 4. -
DSA application without name server
Facilities are now provided to override the location of RCI units using run-time configuration parameters (from configuration file, command line, or environment variables). When all RCI locations are provided through configuration, the DSA name server can be disabled altogether, by specifying "None" as the name server type in the gnatdist configuration. -
Executable name in traces
The name of the executable can now optionally be included in trace messages logged to standard error. This feature is enabled by setting "exe_name=true" in section [log] of the PolyORB configuration. -
Examiner option to ignore SPARK 2014 aspects
If the language profile is set to 2014 (-lang=2014) the Examiner will ignore SPARK 2014 aspects in the source text. This allows both SPARK annotations and aspects to be present in the same code, enabling it to be analysed with the existing SPARK toolset and the new SPARK 2014 tools. This is designed to be useful when migrating existing SPARK code to SPARK 2014. -
New gnatls switch -aPdir
A new switch -aPdir is added to gnatls. When gnatls is called with one or several switches -aPdir and also switch -v, the directories specified in the -aP switches are displayed immediately after the current directory in the Project Search Path. A new warning is issued by gnatls for switches that are not recognized by gnatls. The GNAT driver when called as "gnat ls/list -aPdir ..." will also use the switch -aPdir in its invocation of gnatls. -
New pragma Loop_Variant
A new assertion pragma Loop_Variant appears in loops to specify expressions whose value is guaranteed to increase or decrease on each loop iteration. This can be used to guarantee that a loop makes progress, and is useful in helping to show that loops always terminate. -
GPS: simplified CodePeer report window
The CodePeer report window has been simplified to improve usability and remove unneeded information. Access to the various filters is also improved. -
New pragma Assert_And_Cut
A new pragma Assert_And_Cut is available. This is identical to Assert (except that the name Assert_And_Cut must be used in an Assertion_Policy pragma to control it). The intention is that it be used in the middle of the code for a subprogram, to sum up all the work done up to that point. -
New pragma Assume
A new pragma Assume is available. This is identical to Assert (except that the name Assume must be used in an Assertion_Policy pragma to control it). The intention is that this be used for assumptions about the external environment that cannot be verified from the program alone. -
New check name Predicate_Check
A new check name Predicate_Check is available that can be used in Suppress and Unsuppress pragmas. This allows predicate checks to be turned on and off for specific sections of code (unlike the effect of Assertion_Policy which is to enable or disable predicates at the point where they are defined). -
New manual review classification
When doing a manual review of a message, the user can no longer change the message ranking, but instead specify a review classification and the name of the reviewer. -
New procedure: Set_Close_On_Exec for sockets
A new procedure GNAT.Sockets.Set_Close_On_Exec is now available, allowing users to indicate that a given socket should not be inherited by spawned processes (on platforms where this is supported). -
gprinstall now preserves timestamps
gprinstall now preserves timestamps when copying the source files, object files and libraries. -
Support for—version/—help switches
CodePeer now recognizes the --version and --help switches in addition to the existing -v and -help, for consistency with other tools. -
New package GNATCOLL.Iconv
This optional package provides a binding to libiconv, to convert between various character encodings. -
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.