comp.lang.ada
 help / color / mirror / Atom feed
* No_Abort_Statements
@ 2003-07-31 19:40 Stephan Heinemann
  2003-07-31 20:55 ` No_Abort_Statements Randy Brukardt
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Heinemann @ 2003-07-31 19:40 UTC (permalink / raw)


D.7.5 says

No_Abort_Statements
There are no abort_statements, and there are no calls on
Task_Identification.Abort_Task.

My compiler (gnat) detects only the violation caused by "abort T;". But I 
get
away with "Abort_Task(T'Identity);" or using ATC via select (see below).
Now, I am not quite sure what this restriction really covers... Abort_Task
should obviously be detected but what about ATC?

Thanks in advance,
Stephan

pragma Restrictions(No_Abort_Statements);

with Ada.Task_Identification; use Ada.Task_Identification;
with Ada.Text_IO; use Ada.Text_IO;

procedure No_Abort_Statements is

    task type A;
    task body A is
    begin
        loop
            Put_Line(Image(Current_Task));
            delay 0.5;
        end loop;
    end A;

    T : A;

begin
    abort T;
    
    --Abort_Task(T'Identity);
    
    --select
    --    delay 1.0;
    --    Put_Line("aborted");
    --then abort
    --    declare
    --        T : A;
    --    begin
    --        delay 2.0;
    --    end;
    --end select;
    
end No_Abort_Statements;




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

* Re: No_Abort_Statements
  2003-07-31 19:40 No_Abort_Statements Stephan Heinemann
@ 2003-07-31 20:55 ` Randy Brukardt
  2003-07-31 22:05   ` No_Abort_Statements Samuel Tardieu
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Brukardt @ 2003-07-31 20:55 UTC (permalink / raw)


"Stephan Heinemann" <zombie@cs.tu-berlin.de> wrote in message
news:bgbrbg$3ds$1@news.cs.tu-berlin.de...
> D.7.5 says
>
> No_Abort_Statements
> There are no abort_statements, and there are no calls on
> Task_Identification.Abort_Task.
>
> My compiler (gnat) detects only the violation caused by "abort T;". But I
get
> away with "Abort_Task(T'Identity);" or using ATC via select (see below).
> Now, I am not quite sure what this restriction really covers... Abort_Task
> should obviously be detected but what about ATC?

The restriction covers what it says; there isn't anything implied. An ATC
contains neither an abort_statement (check the grammar) nor a call to
Abort_Task.

It seems like there should be a way to eliminate ATC as well. Ravenscar uses
No_Select_Statements (which will be in Ada 0Y), but that is too broad a
brush if you just want to get rid of aborts.

You probably should send a bug report to ACT (about the missing Abort_Task)
and a comment to Ada-Comment (about ATC).

                         Randy.






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

* Re: No_Abort_Statements
  2003-07-31 20:55 ` No_Abort_Statements Randy Brukardt
@ 2003-07-31 22:05   ` Samuel Tardieu
  2003-08-01 20:07     ` No_Abort_Statements Randy Brukardt
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Tardieu @ 2003-07-31 22:05 UTC (permalink / raw)


>>>>> "Randy" == Randy Brukardt <randy@rrsoftware.com> writes:

Randy> It seems like there should be a way to eliminate ATC as
Randy> well.

There is: pragma Restrictions (Max_Asynchronous_Select_Nesting = 0);

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam



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

* Re: No_Abort_Statements
  2003-07-31 22:05   ` No_Abort_Statements Samuel Tardieu
@ 2003-08-01 20:07     ` Randy Brukardt
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Brukardt @ 2003-08-01 20:07 UTC (permalink / raw)


"Samuel Tardieu" <sam@rfc1149.net> wrote in message
news:87smom4aiq.fsf@inf.enst.fr...
> >>>>> "Randy" == Randy Brukardt <randy@rrsoftware.com> writes:
>
> Randy> It seems like there should be a way to eliminate ATC as
> Randy> well.
>
> There is: pragma Restrictions (Max_Asynchronous_Select_Nesting = 0);

You're right, I missed that. (I forgot that no nesting means no ATC).

So the answer to the original question is to use both
    pragma Restrictions (No_Abort_Statements);
and
    pragma Restrictions (Max_Asychronous_Select_Nesting => 0);

(And still sent a bug report to ACT.)

                 Randy.






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

end of thread, other threads:[~2003-08-01 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-31 19:40 No_Abort_Statements Stephan Heinemann
2003-07-31 20:55 ` No_Abort_Statements Randy Brukardt
2003-07-31 22:05   ` No_Abort_Statements Samuel Tardieu
2003-08-01 20:07     ` No_Abort_Statements Randy Brukardt

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