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

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