On 21/01/2023 23:43, Simon Belmont wrote:
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,
To be pure it can contain only things that can be pre-elaborated, iirc,
so only types, no functions.
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;
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)