GNAT Zero Foot Print - Take 5 - Assert and Aggregates

17/09/18, modified 17/09/18

Unfortunately, I've added a more files to the ZFP runtime. These files are all needed to support the full Ada syntax;

Assert
The mechanism behind the Assert pragma depends on the Ada.Assertions module (implemented in the files adainclude/a-assert.adb and adainclude/a-assert.adb), see also the LRM. This module was added but no visible effect was found when compiling an Ada module with an assert pragma. The GNAT compiler instead uses the Raise_Assert_Failure procedure (in file adainclude/s-assert.adb).
Aggregates
Some operations on arrays will apply for every element of an array. For example clearing an array with something like A := (others => 0);. The operations are called aggregate and depend on memcpy and memcmp. These functions are not available when compiling without any C library. The GNAT source contains Ada implementations for both and I've included memcmp function (in file adainclude/s-memcom.adb). Such a version is portable but not really optimal, so for memcpy I've included the code from the MUSL C library. So far I've only used memcmp, so more testing is needed.

To use this code, download the patch and signature;

And then press and play.

Leave a Reply