How to enable External_Initialization, finally, no_raise etc?

Hi, I copy here an issue I raised on gnat’s github, because I have had no answer in 3 weeks, which is strange given how simple it is. I assume there are not people here. Not good for the n°1 compiler…
I want to activate all extensions to use External_Initialization, and “finally” as according to the site, it should be available through -gnatX0. I have gnat_native_14.2.1_06bb3def`, but all I can use from experimental extensions are the conditional return statements. Experimental aspects are not recognized (““Adjust” is not a valid aspect identifier”).
Do I need an ever newer version ? Where to find it ? Not on alire at least.

pragma Extensions_allowed (All);
procedure main is
  S: constant String with External_Initialization => "essai.txt";
begin
  null;
end main2;

It will be in GCC 15.
If essai.txt is missing, my last experimental build (20241201) reports

gnatmake extensions.adb
gcc -c extensions.adb
extensions.adb:5:06: error: cannot find input file
gnatmake: "extensions.adb" compilation error

and I suppose it would be helpful if it told us which input file was missing.


If there was widespread demand, I could provide occasional builds: but only for macOS, and only on Apple silicon (aarch64).

1 Like

Sure, I can imagine nothing more useful! :rofl:

Hey ! I find them awesome ! Don’t you dare belittle a boy’s bright new toys ! Finally in particular makes constructions so much more elegant. I’ll wait for a linux build, thanks.

As Simon said, this will be available in GCC 15. I started today reading through the GCC-Ada changelog files to create the written down summary of the changelog in the main page… Stay tuned (but it will take a long while).

Best,
Fer

1 Like

Also, remember that you can use Compiler Explorer and try out the newer versions of the compiler. Just select the master/truck branch/version of GNAT and you can test the new features. Though, as you are not running it locally, I do not know how you can use an external file :confused:

2 Likes

You might be able to get it to read its own source?

1 Like

That made me think of:

2 Likes

It can read its own source.

MOV @-(PC), @-(PC)

if I correctly remember PDP-11 Assembly…