comp.lang.ada
 help / color / mirror / Atom feed
* Are "Pragma inline" and "is separate" compatible ?
@ 1998-12-01  0:00 Hans Marqvardsen
  1998-12-02  0:00 ` Stuart Palin
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Marqvardsen @ 1998-12-01  0:00 UTC (permalink / raw)


I have a package PAK which contains a procedure SEP which is separate.

Now I would like to inline SEP. Is that possible?

Below is an example of what I want, but it does not work.
(OA7 complains that the body of the subprogram is not available)


package PAK is 
	procedure SEP;	pragma inline (SEP);
end PAK;

Package body PAK is
	procedure SEP is separate;
end PAK;

separate (PAK)
procedure SEP is 
begin  null; end;

with PAK;
procedure MAIN is
begin
	PAK.SEP;
end;




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Are "Pragma inline" and "is separate" compatible ?
  1998-12-01  0:00 Are "Pragma inline" and "is separate" compatible ? Hans Marqvardsen
@ 1998-12-02  0:00 ` Stuart Palin
  0 siblings, 0 replies; 2+ messages in thread
From: Stuart Palin @ 1998-12-02  0:00 UTC (permalink / raw)


Hans Marqvardsen wrote:
> 
> I have a package PAK which contains a procedure SEP which is separate.
> 
> Now I would like to inline SEP. Is that possible?

It is possible (in general terms - don't know about your specific
compiler), but the body of the inlined procedure must be compiled before
the unit that uses it (otherwise the compiler does not know what code to
inline).

In your example this would mean compiling the separate procedure SEP
before the procedure MAIN.

--
Stuart Palin
Consultant Engineer
Avionic Systems Division (Rochester)
Marconi Electronic Systems Ltd




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-12-02  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-01  0:00 Are "Pragma inline" and "is separate" compatible ? Hans Marqvardsen
1998-12-02  0:00 ` Stuart Palin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox