comp.lang.ada
 help / color / mirror / Atom feed
* Question about pragma Restrictions(No_Recursion)
@ 2014-07-22 18:17 Peter Chapin
  2014-07-22 18:40 ` Robert A Duff
  2014-07-22 19:02 ` Jeffrey Carter
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Chapin @ 2014-07-22 18:17 UTC (permalink / raw)


Hello!

In section H.4 of the Ada RM No_Recursion is described by saying, "As
part of the execution of a subprogram the same subprogram is not invoked."

Paragraph 27 says, "Program execution is erroneous if pragma
Restrictions(No_Recursion) has been specified and a subprogram is
invoked as part of its own execution..."

I understand this to mean that the restriction, in this case, is really
a restriction on what the programmer does. The compiler is not obligated
to detect recursive constructs, however it could potentially (maybe)
simplify its runtime system on the assumption that no recursion exists.
If that assumption is wrong, well it's the programmer's problem.

This is to be contrasted with a number of the other restrictions listed
in H.4 that seem to put requirements on the compiler to explicitly
diagnose attempts to use the restricted feature.

Does that sound right?

Peter


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

end of thread, other threads:[~2014-07-22 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 18:17 Question about pragma Restrictions(No_Recursion) Peter Chapin
2014-07-22 18:40 ` Robert A Duff
2014-07-22 19:02 ` Jeffrey Carter

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