========================= GNAT 19 NEW FEATURES LIST ========================= Copyright (C) 2021, AdaCore This file contains a complete list of new features in version 19 of GNAT. A full description of all GNAT features can be found in the GNAT User's Guide and GNAT Reference Manual. An ISO date (YYYY-MM-DD) appears in parentheses after the description line. This date shows the implementation date of the feature. Any 19.0w wavefront subsequent to this date will contain the indicated feature, as will any subsequent 19 or later release. NF-SA10-068 Android Development Kit for Ada (2020-04-29) For users developing Android apps using Android Studio, GNAT Pro now includes an Android Development Kit for Ada, aimed at assisting with the integration of Ada projects inside their app. For more information on this kit, refer to the GNAT User's Guide Supplement for Cross Platforms. NF-S214-046 User-defined linker scripts for bareboard targets (2019-03-21) Users can now specify their own linker scripts for all bareboard runtimes by invoking GPRbuild with the switch -XLOADER=USER. NF-RC07-030 Explicit debugger error calling functions on VxWorks (2018-12-13) Calling a function in the program being debugged and running on VxWorks is not supported. The debugger has been enhanced to produce an explicit error message when this is attempted rather than performing an operation that may have unpredictable consequences on the system. NF-RB27-040 Compiler workaround for hardware issue on the GR6 (2018-12-17) The lmp-elf/visium-elf toolchain now produces code for the GR6 that automatically works around the pipeline hazard affecting the absolute branch instructions. NF-R913-017 Warning on packed record layout with -fdump-ada-spec (2018-09-14) The compiler now issues a warning on packed record layout when generating C/C++ bindings by means of -fdump-ada-spec. NF-R904-046 Floating-Point State Register initialized on LEON3 (2018-09-19) The LEON3 runtimes now zero the Floating-Point State Register (fsr) as part of their startup routines. NF-R830-031 Inlining of renamed subprogram instances in package (2018-09-02) The compiler now inlines a call to a renaming of an generic subprogram instance declared in a package body, consistent with inlining of a call to a renaming of a regular subprogram. NF-R803-024 New library units for dimensional analysis (2018-08-06) The GNAT library now provides units System.Dim.Float_Mks and System.Dim.Long_Mks in addition to the existing System.Dim.Mks. The new units use types Float and Long_Float, respectively, as base types for the roots of the dimension systems, instead of Long_Long_Float as used in System.Dim.Mks. Other units for defining constants and I/O are defined, to duplicate the features available for System.Dim.Mks. NF-R628-018 Reduced -Wstack-usage false positives with variants (2018-07-01) The number of false positives reported by the compiler for the -Wstack-usage warning on discriminated records with a variant part has been reduced. NF-R627-006 Switch to full Ada 2012 syntax for C/C++ binding (2018-07-04) The C and C++ bindings generated by means of the -fdump-ada-spec option now use full Ada 2012 syntax instead of being limited to Ada 2005 syntax. NF-R530-026 Preelaborable unit GNAT.Array_Split (2018-05-30) GNAT.Array_Split is now a preelaborable unit, allowing other preelaborable units to depend on it. NF-R529-013 AI12-0252 implemented on Ravenscar-SFP and -Full (2018-07-05) Ada Issue AI12-0252 requires that the runtime shall terminate with a Program_Error when more than one interrupt handler is attached to the same interrupt and the restriction No_Dynamic_Attachment is in effect. NF-R525-006 New parameter for Membership_Tests rule (2018-06-04) A parameter Float_Types_Only was added to the gnatcheck Membership_Tests rule. This parameter limits the rule to flagging only those membership test expressions that operate on objects of floating-point types. NF-R525-005 New parameter for Recursive_Subprograms rule (2018-06-15) A new parameter Skip_Dispatching_Calls is added to the gnatcheck Recursive_Subprograms rule. When activated with this parameter, the rule excludes all dispatching calls from the analyzed call chains. NF-R525-004 New parameter for Visible_Components rule (2018-05-28) A parameter Tagged_Only was added to the gnatcheck Visible_Components rule. This parameter limits the rule to flagging only tagged type declarations. NF-R515-012 Better object code for initialization of bitfields (2018-06-07) The object code produced by the compiler for initialization of and, more generally, for the assignment of bitfields, that is to say components of record types whose position or size is not a multiple of the storage unit, can now be more efficient at run time when the software is compiled at optimization level -O2 or above. NF-R504-012 gnatpp: support for preprocessing symbols (2018-05-09) Allow preprocessing symbols like $ppsym as an identifier. Preprocessing directives (starting with '#') are still not supported. NF-R503-023 Extend applicability of pragma Thread_Local_Storage (2018-05-07) The GNAT-specific pragma Thread_Local_Storage can now be applied to an object of a composite type initialized with an aggregate whose subcomponents are all static. Those components cannot be packed or depend on discriminants, which ensures that the aggregate does not require any elaboration code. NF-R502-040 New version of Define_Switch in GNAT.Command_Line (2018-05-03) A new version of Define_Switch taking a callback has been added in GNAT.Command_Line. This new version of Define_Switch allows more control over the switch parameters. NF-R502-005 Dangling-cursor checks in Element function (2018-06-03) In Ada.Containers.Ordered_Maps, if a dangling cursor is passed to the Element function, execution is erroneous. Therefore, the compiler is not obligated to detect this error. However, we have inserted code that will detect this error in some cases and raise Program_Error. The same applies to Ordered_Sets, Ordered_Multisets, Indefinite_Ordered_Maps, Indefinite_Ordered_Sets, and Indefinite_Ordered_Multisets. A "pragma Suppress (Container_Checks);" will suppress this check (and all other container checks as well). NF-R426-014 florist: Conversions between String and POSIX_String (2018-04-30) It is now possible to use a type conversion to convert between String and POSIX_String. This is much more efficient than using the To_POSIX_String and To_String functions. NF-R422-003 Improved compatibility for imported C++ classes (2018-07-10) The compatibility of the support for imported C++ classes and methods with the C++ compiler has been improved in LTO mode. NF-R418-016 New function returning nanosecs since the Unix Epoch (2018-04-24) A high-precision Unix time function, To_Unix_Nano_Time, has been added to package Ada.Calendar.Conversions. The function takes as input the value of Ada.Calendar.Clock and returns the number of nanoseconds since the Unix Epoch. NF-R417-007 Mitigation of the Spectre V2 vulnerability for x86 (2018-01-17) The mitigation mechanism of CVE-2017-5715 (aka the Spectre V2 vulnerability) for the x86 architecture, called retpolines, is now available by means of the -mindirect-branch and -mfunction-return switches. It is not enabled by default. NF-R416-049 GNAT pragma and aspect Max_Entry_Queue_Depth (2018-05-07) The compiler now recognizes pragma/aspect Max_Entry_Queue_Depth, consistent with the GNAT-specific restriction of the same name. Its behavior is identical to the predefined aspect and restriction Max_Entry_Queue_Length. NF-R404-005 Buffered ARM semihosting IO (2018-04-23) Semihosting is a relatively slow communication channel. Since most of the time required for semihosting is not consumed for the data itself but rather in the handling of breakpoint and communication between the target and debugger, sending one byte costs almost as much time as sending a buffer of multiple bytes. For this reason, we now use an output buffer for the semihosting Put functions. The buffer is flushed when full or when a line feed is transmitted. NF-R321-053 -U option for gnatelim (2018-03-26) -U option is added to gnatelim. With this option gnatelim processes all the files from the argument project rather than just the closure of the argument main, but this does not require building the main unit before calling gnatelim for it. NF-R321-049 Disable binder creation of main task secondary stack (2018-03-22) Users can now specify that the binder should not create a secondary stack for the main (environment) task, by using the binder switch -Q0. This is useful for ZFP runtime users who allocate secondary stacks for their application themselves. NF-R315-020 Support for C99 and C++ standard boolean types (2018-03-18) The type Interfaces.C.Extensions.bool has been changed to be fully compatible with the C99 and C++ standard boolean types. This means that the type is now a boolean type in Ada too and thus requires the use of enumeration literals False and True in lieu of integer literals 0 and 1. NF-R309-035 Unbounded strings: inline Initialize and Adjust (2018-03-17) Procedures Initialize and Adjust in the Ada.Strings.Unbounded package are now inlined for nondispatching calls. The same goes for the Wide_ and Wide_Wide_ versions. NF-R220-051 Minimal correct C/C++ binding for (2018-02-21) The C and C++ bindings generated by means of the -fdump-ada-spec option now support the stddef.h standard header compiled in C11 or C++11 mode. NF-R216-038 Support for nested enumeral types in C/C++ binding (2018-02-18) The C and C++ bindings generated by means of the -fdump-ada-spec option now support enumeral types declared implicitly or explicitly within structure or class types. NF-R214-035 Task suspension and elaboration (2018-02-15) The elaboration mechanism of the compiler now treats tasks suspended by calling Ada.Synchronous_Barriers.Wait_For_Release or Ada.Synchronous_Task_Control.Suspend_Until_True as always blocking at elaboration time when restriction No_Entry_Calls_In_Elaboration_Code or compiler switch -gnatJ (relaxed elaboration checking mode enabled) is in effect. This behavior is similar to that of accept and select statements. NF-R208-032 Suppression of elaboration warnings (2018-02-13) It is now possible to suppress an entire chain of elaboration warnings by suppressing elaboration warnings on the root of the chain using pragma Warnings. NF-R207-045 More robust C/C++ binding for incomplete types (2018-02-15) The C and C++ bindings generated by means of the -fdump-ada-spec option can now deal with forward declarations in more cases and also with incomplete, a.k.a. opaque, types. NF-R207-039 Is_Foreign_Exception predicate now available (2018-02-15) The GNAT.Exception_Actions package now features Is_Foreign_Exception, a function allowing users to check if a given exception occurrence represents a foreign exception, such as one originally thrown from C++. NF-R206-006 Addition of function Name_Case_Equivalence (2018-05-04) The library package Ada.Directories now provides the function Name_Case_Equivalence, as defined in the Ada 2012 Reference Manual. NF-R201-030 New switch -mfsmuld for LEON2 cross-platforms (2018-02-15) The switch -mfsmuld has been implemented in the compiler for LEON2 targets to control the generation of the Floating-point Multiply Single to Double (FsMULd) instruction. Its negated form -mno- fsmuld is enabled by default for LEON2 targets. NF-R124-029 Warnings for unused formals of expression functions (2018-03-21) The compiler extends the detection of unused formal parameters to include formals of expression functions. Due to the syntax of expression functions it is not possible to suppress the warnings via pragma Unreferenced, so instead you may use pragma Warnings or simply prefix unused parameters with Dummy_*, Unused_*, Junk_*, or Ignored_*. NF-R124-006 Machine-parsable format for -gnatR output (2018-04-23) The representation information output by the -gnatR switch can now be emitted in a machine-parsable format, namely the JSON data- interchange format specified by the ECMA-404 standard. NF-R115-017 Attribute Valid_Scalars on private types (2018-01-24) Attribute Valid_Scalars can now be applied to a prefix of an untagged private type. NF-R112-024 Disable name generation for tagged types (2018-02-15) Simultaneously applying pragmas or aspects Discard_Names and No_Tagged_Streams to tagged types causes their Expanded_Name and External_Tag to be initialized with empty strings. This is useful for preventing the occurrence of these string names in object code. NF-R111-024 Pure function calls with by-reference In parameters (2018-06-11) The compiler can now optimize away redundant or useless calls to pure functions that take a by-reference In parameter when optimization is enabled. NF-R109-017 New semantics for pragma Elaboration_Checks (2018-01-12) Pragma Elaboration_Checks is now subject to new placement rules. The pragma may appear in a configuration pragmas file, or prior to the context clauses of a compilation unit's initial declaration. Any other placement will result in a warning, and the misplaced pragma will have no effect. NF-R105-012 Warning on out-of-range scalar object default value (2018-01-08) The compiler now issues a warning on a default-initialized scalar object of a type with a specified Default_Value aspect when the default value does not satisfy the constraint on the object's subtype. NF-QC30-001 More robust C binding for preprocessor macros (2018-01-03) The C and C++ bindings generated by means of the -fdump-ada-spec option can now deal with more floating-point constants and with string concatenation in preprocessor macros. NF-QC20-042 Wider use of attribute Scalar_Storage_Order (2018-01-09) The GNAT-specific attribute Scalar_Storage_Order can now apply to formal private types. Previously the attribute had the same semantics as the language-specific attribute Bit_Order, but in GNAT mode its use was allowed in generics to support instantiations of Ada.Sequential_IO. This extension is now seen as generally useful. NF-QC07-024 Warning on membership and user-defined equality (2017-12-07) A warning has been added for a membership operation applied to a scalar type for which a user-defined operation exists. The Ada language specifies that in that case the predefined equality is used to evaluate the membership expression. This is potentially confusing because for record types and limited types it is the user-defined equality that is used to evaluate membership. NF-QC06-002 GNATstack enhanced message for unrecognized options (2017-12-07) When an option is passed that is not supported by GNATstack, a message is now printed indicating the specific option that is not recognized. NF-QB30-060 More flexible symbolic traceback cache service (2018-01-12) On Linux platforms, enabling the symbolic traceback cache now works in contexts where the program is spawned with an argv[0] referencing the executable file with only its base name, when this file is present in the current directory and '.' is not in the PATH. NF-QB30-039 Improved string literals management on ELF targets (2018-01-16) On ELF targets, when compiling with optimization or -fmerge- constants, the space allocated to multiple instances of identical string literals, such as those occurring in generic instantiations, is now managed more efficiently. A unique copy of each distinct literal value is emitted in executable programs or libraries when possible. NF-QB23-037 Expression functions do not trigger loading (2017-11-29) An expression function defined in a package spec that also completes a previous declaration does not cause the associated package body to be loaded and analyzed by the compiler. NF-QB20-042 Optimize allocators for arrays with dynamic bounds (2017-12-01) The compiler now builds allocators for arrays whose upper bound is a nonstatic expression without creating an anonymous array object first and then assigning it to the allocated object. The designated object is built in place directly, which extends existing optimizations for array allocators and prevents stack overflows on some targets. NF-QB20-012 Support for tagged types in the CCG compiler (2018-01-05) The Common Code C Generator compiler has been enhanced to support declarations of tagged and class-wide type objects. Dispatching and class-wide subprograms are also supported (including the object.operation notation). NF-QB16-039 Improved memory allocation for zfp and ravenscar-sfp (2017-11-27) The dynamic memory allocation provided by the GNAT runtime for bare-metal targets has been improved. Previously, a buffer with a fixed 20 kB size was used to provide dynamic allocation. The new mechanism relies on the memory size information given by the linker script and uses the memory that is not used by the application to provide dynamic allocation. Also, the memory allocation provided by the ravenscar-sfp runtimes is now task- safe. NF-QB15-039 New GDB/MI command to stop at exception handler (2018-04-04) The debugger can now stop at the start of exception handlers when working in GDB/MI mode. NF-QB06-036 Improved error message when unable to print variable (2017-11-07) The debugger has been enhanced to provide more information when failing to print the value of a variable. This can happen, for instance, when part or all of the variable being printed has been optimized out. NF-QA10-019 Board-Support Package for the Microsemi M1AGL (2018-01-09) The M1AGL is an FPGA chip on which it is possible to synthesize a Cortex-M1 processor. The Board-Support Package provides Ravenscar tasking (Small-FootPrint profile) as well as a Zero-FootPrint run- time for this platform. For implementation details see the README file delivered with the BSP. NF-QA10-007 New option --ignore=filename for ASIS-based tools (2017-11-27) A new option --ignore=filename has been added to gnatmetric, gnatpp, gnat2xml, and gnatcheck. This option allows specifying a list of source files that will not be processed by these tools. NF-Q913-025 New debugger command to stop on exception handlers (2018-01-09) The debugger now supports a new form of catchpoint that can be set to stop at the beginning of exception handlers. NF-Q901-021 Restriction Static_Dispatch_Tables (2017-10-31) A new restriction Static_Dispatch_Tables is implemented, which prevents the declaration of tagged types requiring dispatch tables that cannot be placed in read-only memory. NF-Q726-017 Enable/disable location range in gdb (2017-11-14) It's now possible to enable/disable a location range in gdb using the syntax: .- NF-Q724-015 gnatpp: --no-align-modes switch (2018-01-23) Alignment of 'in' and 'out' can be disabled with the --no-align- modes switch. NF-Q721-023 Link-time speedup for large executables on Windows (2017-12-31) The link phase of large executables using many DLLs has been significantly sped up on Windows (up to 15x in some cases). NF-Q712-027 Better code generation for interface thunks (2018-08-31) The code generated by the compiler for interface thunks, that is, for trampolines invoked when calling the primitive operations of a tagged type derived from an interface, is now more concise and more efficient at run time in most practical cases. NF-Q619-023 Support added for package Ada.Locales (2018-01-20) The GNAT run-time library has been enhanced to support Ada.Locales. NF-Q619-021 Aggregate project support in gnatmetric and gnatstub (2018-05-12) An aggregate project can be used as a project parameter for gnatmetric and gnatstub only in the case where this project contains exactly one non-aggregate project being aggregated. NF-Q316-025 In-place processing for Initialize_Scalars (2018-02-05) The effects of pragma Initialize_Scalars are now in-place when allocating or initializing an array object where the component type is of size System.Storage_Unit. NF-P830-056 Compressed debug info support on native GNU/Linux (2017-12-08) It is now possible to build programs with compressed debugging information on x86-linux and x86_64-linux platforms. To do so, add -gz to the other debug-related switches used during compilation. NF-P718-013 gnatpp: --insert-blank-lines and case statements (2018-01-23) The --insert-blank-lines switch now inserts a blank line before a case statement. NF-P718-012 gnatpp: --vertical-case-alternatives switch (2018-01-23) The --vertical-case-alternatives switch may be used to tell gnatpp to put additional hard line breaks in case statements, case expressions, and variant parts. NF-P718-011 gnatpp: --vertical-named-aggregates switch (2018-01-23) The --vertical-named-aggregates switch may be used to tell gnatpp to format named aggregates vertically, one association per line, even if the whole thing would fit on a line. NF-P718-010 gnatpp: --preserve-line-breaks switch (2018-01-23) The --preserve-line-breaks switch may be used to tell gnatpp to preserve line breaks occurring in the input. NF-P718-008 gnatpp: --vertical-array-types switch (2018-01-23) The --vertical-array-types switch may be used to tell gnatpp to format array type declarations vertically. NF-P718-006 gnatpp: --vertical-enum-types switch (2018-01-23) The --vertical-enum-types switch may be used to tell gnatpp to format enumeration type declarations vertically, one enumeral per line, even if the whole type would fit on a line. NF-P713-060 gnatbind: -f switch gives an error for duplicates (2018-01-23) If the -f switch is passed to gnatbind, and there are duplicated file names listed, gnatbind now gives an error message. NF-P610-018 gnatpp: libadalang-based pretty printer (2018-01-23) A new version of gnatpp is available that is based on libadalang. This replaces the old ASIS-based gnatpp. The new version provides better formatting overall, and is faster. There are, however, some minor limitations we are still working on. NF-P314-002 New gnatcheck option '--check-redefinition' (2017-12-21) A new option '--check-redefinition' is added to gnatcheck. When this option is specified, gnatcheck checks whether a parameter for a parameterized rule is defined more than once in the set of rules passed to gnatcheck and issues a warning if any parameter redefinitions are present. NF-P226-017 User-defined rule name synonyms in gnatcheck (2017-12-20) When specifying a rule option it is possible to provide a synonym for the rule name. The given synonym is used in generated diagnoses in place of the corresponding gnatcheck rule name when the --show-rule option is specified. NF-N827-012 gnatpp: Object renaming declarations aligned (2018-01-23) Object renaming declarations are now aligned in a similar way to object declarations. NF-N812-011 gnatpp: aspect specifications (2018-01-23) The formatting of aspect specifications has been improved. NF-N605-003 gnatpp: slow processing of subunits (2018-01-23) The new libadalang-based version of gnatpp is much faster at processing subunits than the old ASIS-based version. NF-N428-004 gnatpp: multiple operators per line (2018-01-23) Expressions are now formatted in a more compact way, with potentially more than one operator on the same line. NF-N312-029 gnatpp: --indent-named-statements switch (2018-01-23) The --indent-named-statements switch may be used to tell gnatpp to indent named block and loop statements with respect to the name. NF-N219-016 gnatpp: --split-line-before-record switch (2018-01-23) The --split-line-before-record switch may be used to tell gnatpp to put a line break before "record" in a record type declaration. NF-N117-026 Aggregate project support in gnatcheck (2018-05-12) An aggregate project can be used as a parameter for gnatcheck. When called with an aggregate project, gnatcheck processes all the projects being aggregated one by one and creates a separate report for each of them. It also creates an integrated report that lists all the (non-aggregate) projects that have been processed and the corresponding report files. NF-MB21-028 gnatpp: comments before begin (2018-01-23) If a comment occurs just before 'begin', gnatpp now uses a better heuristic for deciding whether the comment should be indented like 'begin', or like the preceding code line. In particular, if the comment is indented to match the previous code line, with no intervening blank lines, then we will keep it matching. NF-HC18-004 Verbose relax info added to linker map file (2018-07-20) The linker map file for PowerPC ELF targets is enhanced with verbose relax info, namely, with the relaxed symbol name, the section containing said symbol, and the input object containing the call that required relaxing.