Where is the right spot to apply an elaboration pragma to a library level subprogram? GNAT (20210519-103) complains that in the below code C cannot with subprogram A.B because it's not Pure, but it certainly appears to be,
and no amount of shuffling around the pragma in B seems to placate it. Playing with the declaration of T seems to change the behavior; is GNAT is just misreporting a different error?
Thanks
-sb
package A is
pragma Pure;
type T is limited null record;
end A;
procedure A.B (x : T) is
pragma Pure; -- is this the right spot?
begin
null;
end A.B;
with A.B; -- error: cannot depend on "B" (wrong categorization)
package C is
pragma Pure;
end C;
A subprogram is a program unit and may be declared pure. I do not see that A.B performs any of 10.2.1(15ff).
I tried
procedure A.B (x : T) with Pure;
which is accepted together with its body and still got the compiler complaint.
Looks like a compiler problem.
On 22/1/23 20:55, AdaMagica wrote:
A subprogram is a program unit and may be declared pure. I do not see
that A.B performs any of 10.2.1(15ff).
I tried
procedure A.B (x : T) with Pure;
which is accepted together with its body and still got the compiler
complaint.
Looks like a compiler problem.
If you are on linux, then you could set the stack size with
$ ulimit -s unlimited
$ launch_my_app
Regards.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 339 |
Nodes: | 16 (0 / 16) |
Uptime: | 06:20:07 |
Calls: | 7,467 |
Calls today: | 3 |
Files: | 12,691 |
Messages: | 5,626,254 |