From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ebe0c5644ec0bd2,start X-Google-Attributes: gid103376,public From: "Per & Marianne sandberg" Subject: Compiler bug (Semantics of pargma inline) Date: 1999/03/24 Message-ID: #1/1 X-Deja-AN: 458104405 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Trace: newsfeeds.bigpond.com 922221877 139.134.141.0 (Wed, 24 Mar 1999 07:44:37 EST) Organization: Telstra BigPond Internet Services (http://www.bigpond.com) NNTP-Posting-Date: Wed, 24 Mar 1999 07:44:37 EST Newsgroups: comp.lang.ada Date: 1999-03-24T00:00:00+00:00 List-Id: Hi ! Is the compiler aloud to change the semantic of the code if pargma inline is used ? I am asking this question bue to different opinons from my self and the compiler vendor. Never the less here is the code. ---------------------------------------------- with Text_Io; procedure Timer_Test is function Until_Next return Duration; pragma Inline (Until_Next); function Until_Next return Duration is begin Text_Io.Put_Line ("Should never get here!!!"); return 5.0; end Until_Next; function Is_Pending return Boolean is begin return False; end Is_Pending; task type Test_Task_Type is entry Start; entry Stop; end Test_Task_Type; Test_Task : Test_Task_Type; task body Test_Task_Type is Continue : Boolean := True; begin while Continue loop begin select accept Start do Text_Io.Put_Line ("Start."); end Start; or accept Stop do Text_Io.Put_Line ("Stop."); Continue := False; end Stop; or when Is_Pending => delay (Until_Next); Text_Io.Put_Line ("Gaah!"); end select; exception when others => Text_Io.Put_Line ("Ops! Exception..."); end; end loop; end Test_Task_Type; begin Test_Task.Start; delay 15.0; Test_Task.Stop; end Timer_Test; ------------------------------------------------------------ What appends is when pragma inline is used on the "Until_Next" function the function is called even if the guard "Is_Pending" evaluates to false and i considder this a bug regardles of inline or not. Thankfull for ansvers to connvince my compiler vendor. /Per Sandberg