- Ada 2012
- Ada 2005 / 95 / 83
- Embedded Development
- Formal Methods
- Open Source
- Safety-Critical Development
- Static Analysis
Array initialization in loops
SPARK can now detect that some arrays are fully initialized by a loop. The loop range must be statically equal to the array bounds, the array must be assigned to on all paths through the loop, and the array must not be read in the loop itself. This is also supported for multi-dimensional arrays. The SPARK 2014 blog post on this topic contains more details: http://www.spark-2014.org/entries/detail/array-initialization-in-loops
Functions with dependency contracts
The dependency contract on functions is now fully supported: it is enforced in the function's body and expressions making use of such a function will only include the non-null dependencies in their own dependencies.
Feb 26th, 2014
Support for aggregate projects
CodePeer now supports analysis of aggregate project files.
Allow Wide_String output on Windows
Windows supports text mode translation on files, we now take advantage of this by avoiding any encoding in the Ada run-time. This allows Wide_String output on the Windows console to function as expected. As part of this change, two new functions are added to Interfaces.C_Streams (fputwc and set_mode).
Improved compiler performance on big record types
The compile-time performance of the compiler on big discriminated record types containing numerous dynamic fields has been significantly improved, both in terms of peak memory usage and compilation time.
GPS: custom completion resolvers
It is now possible to use Python plug-ins to provide custom entries in the completion window for source files.
Feb 25th, 2014
Alternate output modes for GNAT.Memory_Dump
Output lines from GNAT.Memory_Dump.Dump can now be prefixed with an offset relative to the start of the dump, or have no prefix at all, instead of showing an absolute address.
Feb 23rd, 2014
Switch -gnatR can be used together with -gnatc
You can now use -gnatR and -gnatc together to generate representation information, even if no code is being generated.
Feb 22nd, 2014
New -security switch
A new switch -security is available via the -output-msg switch to generate only messages related to security (as opposed to safety) concerns.
Feb 22nd, 2014
New GNAT.OS_Lib subprograms to work with date/time
There are two new subprograms added to GNAT.OS_Lib to deal with date/time. Set_File_Last_Modify_Time_Stamp sets the last modification time stamp for a given files and GM_Time_Of creates an OS_Time from time parts.
GPS: support for ClearCase “diff against working”
The "ClearCase Native" VCS now supports querying against the working revision.
Feb 20th, 2014
Full style checks for binary operator spacing
Style checks related to binary operator spacing (enabled by -gnatyt, -gnatyg, -gnatyy or -gnatg) were omitted when the left operand was a literal (for example, in expressions such as 16-One or "A"&"B"). These checks are now included when activated by any of the above switches. To aid in transition to this situation of additional style warnings, a new debug switch -gnatd.Q is added which disables these new checks and returns the compiler to its previous state in this respect.
Feb 19th, 2014
Reduced message noise for ineffective subprograms
Subprograms with no outputs (either parameters or globals) used to produce one warning message for each statement. Now a single message is issued for the entire subprogram.
Feb 19th, 2014
Interfaces.C.Extensions added to restricted runtime
The package Interfaces.C.Extensions has been added to the restricted run time. This package provides type declarations which are generally useful in interfacing to C, and in particular, they are utilized by the C/C++ binding generator capability.
Feb 18th, 2014
Utility to generate target configuration file
A small utility found under <install>/share/codepeer/target can be used to generate a target configuration file corresponding to the target Ada compiler used, instead of e.g. writing this file manually.
Null deallocation ignored by gnatmem
An attempt to deallocate a null access value will no longer cause gnatmem to report "Releasing deallocated memory" for such an attempt.
New gnatmem switch -t
A new switch -t is added to gnatmem. This switch causes memory allocated sizes to be always output in Bytes and not in Kilobytes or Megabytes depending on the value.
GPS: new plugin treemove
This plugin improves key navigation in trees like the Project Explorer. Left and Right will now move the cursor up or down, and automatically expand or collapse nodes to match the default behavior on Windows.
Relaxed rules for Scalar_Storage_Order
An explicit Scalar_Storage_Order attribute definition is no longer required for a composite type that has a component that has a Scalar_Storage_Order specified. If no Scalar_Storage_Order attribute is given for the enclosing composite type, it gets the default system storage order. Note that compatibility rules between scalar storage order of nested composites still apply in any case.
The restriction No_Standard_Allocators_After_Elaboration is now fully implemented as defined in the final version of the Ada 2012 RM (the previous implementation was of a partial preliminary version). This includes both of the static illegality cases, and the run-time check.
Unnecessary Loop_Entry constant optimized out
Previously, an unneeded constant was generated for the use of a Loop_Entry attribute used within an ignored assertion pragma. This generation of this constant is now suppressed, since it is not needed for the assertion.
Analyzing subunits with illegal siblings
An undocumented limitation existed that prevented a number of tools (e.g. gnatcheck, gnatpp) from analyzing legal subunits that had illegal siblings. This limitation has been removed.
New C/C++ GPRbuild configurations for WRS Linux
GPRbuild now has configurations for the C and C++ compilers provided by Wind River for use with Wind River Linux. This means those compiler will be invoked when GPRbuild is used to drive a build and C or C++ code is involved.
Controlling parameters queries in Asis.Extensions
Asis.Extensions has two new queries. Controlling_Parameters returns a list of controlling parameters from the declaration of a dispatching operation. Has_Controlling_Result checks for the declaration of a dispatching function if the function has a dispatching result.
Elaboration entities in packages can be suppressed
Normally each package contains a 16-bit counter used to check for access before elaboration, and to control multiple elaboration attempts. With this change, this counter is eliminated for units compiled with the static model of elaboration if restriction No_Elaboration_Code is active. In addition, a new restriction No_Multiple_Elaboration allows suppression of these counters in static elaboration units even if they do have elaboration code. If this restriction is used, then the situations in which multiple elaboration is possible, including non-Ada main programs, and Stand Alone libraries are not permitted.
GPS: Remove xref database with default project
When GPS loads a default project because none is given in argument, it now removes the xref database (gnatinspect.db) on exit.
New aspect Annotate, Entity argument for pragma
An optional final named argument [Entity => local_NAME] is allowed for pragma Annotate to indicate that the annotation is for a particular entity, and a corresponding Annotate aspect is introduced.
Feb 10th, 2014
Advice to use—help for incorrectly invoked tools
When a gpr tool (gprbuild, gprconfig, gprclean or gprinstall) is incorrectly invoked, with at least one argument, the usage will no longer be displayed. Instead this line will be displayed:
type "gprxxx --help" for more information.
gnat2xml now supports parallel processing
The gnat2xml tool now supports the -j switch in --incremental mode, to tell it to run multiple processes in parallel.
ASIS: new switches—incremental and—output-dir
gnat2xml and gnatpp now support two new command-line switches. --incremental invokes incremental processing on a per-file basis. Source files are only processed if they have been modified, or if files they depend on have been modified. This is similar to the way gnatmake/gprbuild only compiles files that need to be recompiled. --output-dir=dir sends the output to directory 'dir'. For gnat2xml, there is one output file for each input file, with ".xml" appended; this replaces the old -m switch. For gnatpp, the output files have the same names as the input files.
All messages about bit-order are now info messages
The messages about bit and byte order in records, from use of the attributes Bit_Order and Scalar_Storage_Order are now info (information) messages rather than warnings, and they are all controlled by -gnatw.v/-gnatw.V. Previously there was a somewhat random mixture of warnings and info messages, some of which were enabled by default, rather than controlled by these switches.
New restriction No_Long_Long_Integers
A new partition-wide restriction No_Long_Long_Integers forbids any explicit reference to type Standard.Long_Long_Integer, and also forbids declaring range types whose implicit base type is Long_Long_Integer, and modular types whose size exceeds Long_Integer'Size.
Feb 8th, 2014
New check name Duplicated_Tag_Check
A new check name Duplicated_Tag_Check, that can be used in pragma Suppress and pragma Unsupress is introduced. If this check is suppressed, then the declaration of a tagged type does not do a check for duplicated external tag name, so no exception is raised for such a duplication. Note that as part of this change, the undocumented debug flag -gnatdQ which also had the effect of suppressing this check is eliminated.
Feb 7th, 2014
Advice to use—help for incorrectly invoked tools
When a gnat tool (gnatbind, gnatchop, gnatclean, gnatfind, gnatls, gnatmake, gnatname, gnatprep or gnatxref) is incorrectly invoked, with at least one argument, the usage is no longer be displayed. Instead this line will be displayed: try "gnatxxx --help" for more information. This message is output using a new procedure GNAT.Command_Line.Try_Help.
GB: Improved new-project wizard
The GNATbench new-project wizard no longer inserts RTP switches in the new project file. Specifically, "-mrtp" and "--RTS=rtp" are now handled automatically by GPRbuild so they are not needed in the project file.
New GNAT unit to rewrite data on the fly
A new GNAT unit named GNAT.Rewrite_Data is available. This unit can be used to rewrite strings within large text blocks without requiring the entire contents to be resident all at once in memory. For example, it can be used to rewrite large files or socket streams.
Static predicate can be given by case expression
The expression that defines a static predicate on a discrete subtype can be given by means of a case expression. This late addition to the Ada 2012 Reference Manual is now fully supported.
gnatls -v: directories in search paths on Windows
The directories displayed by "gnatls -v" in the Source search Path and the Object Search Path now use directory separator '\' on Windows instead of '/'.
gnatmake -gnatA no longer reads gnat.adc
When gnatmake is invoked without a project file and with switch -gnatA on the command line, it no longer reads gnat.adc. So, any compilation error in gnat.adc will not prevent gnatmake from running correctly when invoked with -gnatA.
Invoke the correct gnatbind for unknown targets
When gprbuild is invoked with an unkown target and the Ada compiler is found by gprconfig, the correct gnatbind for the target is now used, instead of the native one.
Better handling of attribute prefix not a name
The prefix of an attribute must be a name, not a general expression. Before, the compiler complained of a missing binary operator in this situation. But now it explicitly notes that a name is required, and in Ada 2012 mode advises about the possibility of using qualification to make the prefix into a name.
Ada Web Server
Feb 3rd, 2014
Add a way to initialize explicitly the SSL layer
It is now possible to initialize explicitly the SSL layer default parameters (certificate filename, security mode, etc...). The default configuration is used for every secure socket created by AWS.
Check distributed build consistency
A check is now done to ensure that build slaves, used on a distributed compilation farm, are all of the same version as the build master.
Warn on record size not a multiple of alignment
A warning is now given for a record type where the size and alignment are specified and the size is not a multiple of the alignment, resulting in an object size that is greater than the specified size value. This warning is on by default, is controlled -gnatw.z/-gnatw.Z, and is included in -gnatwa. The warning can also be suppressed by giving an explicit object size value.
Invalid use of Unrestricted_Access is now illegal
Using Unrestricted_Access to generate a value referencing an unconstrained array type where the object is non-aliased, and the type has been forced to be a thin pointer using a size clause can never work (and has never worked). The bounds are inevitably lost. This case is now diagnosed as illegal. See also NF-73-N126-002.
Ada Web Server
Feb 2nd, 2014
Add support for status code when closing WebSocket
It is now possible to close a WebSocket with a status code.
Improve documentation of pragma Unreferenced
Pragma Unreferenced only applies to possible references that follow the occurrence of the pragma, and this is now made clearer in the GNAT RM.
New gnatbind switch -Ra (include run-time sources)
The gnatbind switch -R lists all units in the binder closure set but excludes run-time units (this exclusion is now clearly documented). The new switch -Ra is similar to -R except that it includes all run-time units.
Mixing thin pointers and Unrestricted_Access
It has always been potentially erroneous to use the Unrestricted_Access attribute to create thin pointer values to unconstrained arrays. This is a fundamental limitation. Thin pointers (where the size of a pointer to an unconstrained array is forced to be normal pointer size) are provided for the purposes of porting legacy code which implicitly assumed this representation. Such code will not in any case be using Unrestricted_Access. This case is now thoroughly documented in the GNAT RM, to minimize the possibility of confusion from these erroneous cases. See also NF-73-N203-005.
Warning pattern now matches anywhere in string
The pattern given for pragma Warning_As_Error or pragma Warnings now matches anywhere in the warning message string without the need to give leading or trailing asterisks in the string.