I published a (pre)release candidate build of GNAT FSF 16.1.0 in the GNAT FSF builds repo. I also added a branch in my fork of the Alire index on GitHub, with the release candidate in it.
We invite you to test this release and tell us if there are any issues we can fix, before we release the actual 16.1.0 version.
There is currently no build for macOS on ARM, as the patched fork we use for that platform hasn’t released a 16.x version yet. But stay tuned!
Thanks for your call for testing, especially for macOS even if unfortunately there is not yet ARM version.
My configuration: macOS 13.7.8, x86_64, Xcode 14.3.1.
Early feedbacks:
Link error: Link [link] test_uxstrings1.adb ld: library not found for -lSystem
User workaround:
ld: warning: object file (/users/me/gnat-x86_64-darwin-16.1.0-1/lib/gcc/x86_64-apple-darwin24.6.0/16.1.0/adalib/libgnat.a(a-assert.o)) was built for newer macOS version (15.0) than being linked (13.0)
User workaround: export MACOSX_DEPLOYMENT_TARGET=15.0
Looks like this new version of GNAT has better checking for Ada RM 4.3.5 (7/5), which requires Add_Unnamed to denote exactly one procedure where in your case it denotes two.
Unfortunately we cannot build for all existing macOS versions… For the time being we will try to support the latest version of macOS and version N-1. It’s a pity that homebrew doesn’t build a GNAT compiler, they have packages for each supported macos version.
There was a time when MacPorts had an Ada compiler that functioned (SIGH) I don’t use homebrew. Looking forward to arm64 MacOS, as working with the Rosetta emulation is slower than molasses in a Minnesota winter…
284. subtype Roman_Character is Wide_Wide_Character with
285. Static_Predicate => Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
286.
287. Max_Roman_Number : constant := 3_999; -- MMMCMXCIX
288.
289. type Roman_Number is range 1 .. Max_Roman_Number
290. with String_Literal => To_Roman_Number;
291.
292. function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
293. with Pre => S'Length > 0 and then
294. (for all Char of S => Char in Roman_Character);
I got the error: aarm_202x_ch04.adb:290:32: error: nonoverridable aspect "String_Literal" of type "Roman_Number" requires "To_Roman_Number" declared at line 292 to be a primitive operation
That’s interesting. I’m unable to reproduce on x86-64 Linux. I copied the code from Ada 2022 RM 4.2.1 into this package, and I get no compilation errors:
package Example is
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
subtype Roman_Character is Wide_Wide_Character
with
Static_Predicate =>
Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
Max_Roman_Number : constant := 3_999; -- MMMCMXCIX
type Roman_Number is range 1 .. Max_Roman_Number
with String_Literal => To_Roman_Number;
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
with
Pre =>
S'Length > 0 and then (for all Char of S => Char in Roman_Character);
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
is (declare
R : constant array (Integer range <>) of Roman_Number :=
[for D in S'Range =>
Roman_Digit'Enum_Rep
(Roman_Digit'Wide_Wide_Value (''' & S (D) & '''))];
-- See 3.5.2 and 13.4
begin
[for I in R'Range =>
(if I < R'Last and then R (I) < R (I + 1) then -1 else 1) * R (I)]'
Reduce ("+", 0));
X : Roman_Number := "III" * "IV" * "XII"; -- 144 (that is, CXLIV)
end Example;
I double-checked I’m using the correct compiler version:
gcc (GNAT-FSF-builds) 16.1.0
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Perhaps there is something else in your package that’s interfering? Are you able to reproduce with the above snippet?
procedure Example_B is
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
subtype Roman_Character is Wide_Wide_Character
with
Static_Predicate =>
Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
Max_Roman_Number : constant := 3_999; -- MMMCMXCIX
type Roman_Number is range 1 .. Max_Roman_Number
with String_Literal => To_Roman_Number;
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
with
Pre =>
S'Length > 0 and then (for all Char of S => Char in Roman_Character);
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
is (declare
R : constant array (Integer range <>) of Roman_Number :=
[for D in S'Range =>
Roman_Digit'Enum_Rep
(Roman_Digit'Wide_Wide_Value (''' & S (D) & '''))];
-- See 3.5.2 and 13.4
begin
[for I in R'Range =>
(if I < R'Last and then R (I) < R (I + 1) then -1 else 1) * R (I)]'
Reduce ("+", 0));
X : Roman_Number := "III" * "IV" * "XII"; -- 144 (that is, CXLIV)
begin
null;
end Example_B;
procedure Section_4_5_10_Paragraph_36 is
type Real is digits 8;
function Factorial(N : Natural) return Natural is
([for J in 1..N => J]'Reduce("*", 1));
-- Example of a reduction expression that computes the Sine of X using a Taylor expansion:
function Sine (X : Float; Num_Terms : Positive := 5) return Float is
([for I in 1..Num_Terms => (-1.0)**(I-1) * X**(2*I-1)/Float(Factorial(2*I-1))]
'Reduce("+", 0.0));
begin
null;
end Section_4_5_10_Paragraph_36;
The compilation never ended with switch -gnatVa: $ gcc -c -gnat2022 section_4_5_10_paragraph_36.adb -gnatVa
I don’t know if this is useful info or not, but when I try to declare tagged types with primitive operations directly in a procedure declarative region, it has always complained to me in older versions. I wonder if the error was intended from the get go and only just recently got fixed up? I’ve always had to put tagged types + primitive operations in a package inside the declarative region of a procedure to get it work. Something like:
procedure Example_B is
package Some_Name is
-- Types and primitive ops
end Some_Name;
use Some_Name; -- so you don't have to work with the extra package name if you don't want to
begin