The official ChangeLog is quite brief. I’d like to share my findings on what’s new in this version. Comparing the documentation with the previous version, I have found the following new features.
In the GNAT User’s Guide chapter Building Executable Programs with GNAT, new compiler options have been added:
-
-gnatX0
Enable all GNAT implementation extensions and latest Ada version. -
-gnatw_q
Activate warnings for ignored equality operators.
In the chapter GNAT and Program Execution, it is mentioned that Position-Independent Executables (PIE) are now enabled by default, which means that addr2line
no longer works out of the box. Instead, it is recommended to use gnatsymbolize --load
and it is shown how to determine the current code load address.
The Reference Manual specifies a new restriction, No_Local_Tagged_Types. In the chapter The GNAT Library, new packages GNAT.Binary_Search and GNAT.Generic_Fast_Math_Functions (this should use SIMD when possible) have been added. The chapter Security Hardening Features has been clarified and supplemented with two sections, Hardened Booleans and Control Flow Redundancy.
Unfortunately, the new experimental language extensions have not been included in the documentation. String interpolation has been implemented and described on the AdaCore website. This probably also applies to Pragma Storage_Model and Simpler accessibility model, but I have not checked. The attribute 'Reduce
no longer applies to implementation-defined extensions. Although the use of square brackets is allowed in Ada 2022 for array and container aggregates, it is listed in the documentation as a language extension (requires practical testing, probably just documentation bug).
Looking at the ChangeLog, a lot of changes have been made to support CUDA. For example, gnat_cuda.ads
has been added.
Regarding the improvement of Ada 2022 support, I only found two cases. The 'Index
attribute has been implemented for use in the preconditions and postconditions of input families. Containers have received versions of cursor operations where the first argument is the container object. These include Has_Element
, Element
, Next
, and so on, i.e. we can write My_Set.Has_Element (Cursor)
.
If you find something interesting, please share!