rendered paste bodymain.adb:
with Ada.Text_IO;
procedure Main is
procedure Test(x : Integer) is
begin
Ada.Text_IO.Put_Line(Integer'Image(x));
Test(x+1);
end Test;
begin
Test(0);
end Main;
compiler output:
ns@bunty:~/Desktop/Ada$ gnat make -fstack-check -gnato main.adb
gcc-4.1 -c -fstack-check -gnato main.adb
gnatbind -x main.ali
gnatlink main.ali -fstack-check
ns@bunty:~/Desktop/Ada$
truncated program output:
102342
102343
102344
raised STORAGE_ERROR : stack overflow detected
ns@bunty:~/Desktop/Ada$