comp.lang.ada
 help / color / mirror / Atom feed
* Gnat Problem - Freezing too soon
@ 2019-02-28 18:34 russ lyttle
  2019-02-28 21:19 ` Anh Vo
  2019-02-28 21:22 ` Simon Wright
  0 siblings, 2 replies; 22+ messages in thread
From: russ lyttle @ 2019-02-28 18:34 UTC (permalink / raw)


Example from the bookAnalysable Real-Time Systems :

1  package Environment_Monitor.Ch4_Status is --Protected
2    protected type Methane_Agent (Ceiling : Priority)
3     with Priority => Ceiling
4       is new CH4_Safety
5    with
6      overriding function Check_Safe return Methane_Status;
7      overriding procedure Set_Safety (M : Methane_Status);
8    private
9       Current_Status : Methane_Status := Motor_Unsafe;
10   end Methane_Agent;
11 end Environment_Monitor.Ch4_Status;

Gnat complains that Methane_Agent is frozen at line 2, and line 3 is 
trying to change an attribute after being frozen.

I've found some discussion about gnat freezing things too soon. Is there 
an accepted work-around for the general problem until this issue is 
resolved?

Thanks.

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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 18:34 Gnat Problem - Freezing too soon russ lyttle
@ 2019-02-28 21:19 ` Anh Vo
  2019-02-28 21:31   ` russ lyttle
  2019-02-28 21:22 ` Simon Wright
  1 sibling, 1 reply; 22+ messages in thread
From: Anh Vo @ 2019-02-28 21:19 UTC (permalink / raw)


On Thursday, February 28, 2019 at 10:34:46 AM UTC-8, russ lyttle wrote:
> Example from the bookAnalysable Real-Time Systems :
> 
> 1  package Environment_Monitor.Ch4_Status is --Protected
> 2    protected type Methane_Agent (Ceiling : Priority)
> 3     with Priority => Ceiling
> 4       is new CH4_Safety
> 5    with
> 6      overriding function Check_Safe return Methane_Status;
> 7      overriding procedure Set_Safety (M : Methane_Status);
> 8    private
> 9       Current_Status : Methane_Status := Motor_Unsafe;
> 10   end Methane_Agent;
> 11 end Environment_Monitor.Ch4_Status;
> 
> Gnat complains that Methane_Agent is frozen at line 2, and line 3 is 
> trying to change an attribute after being frozen.
 
I do not have this book. Could you post a minimally compile-able codes if not completed ones.

Anh Vo


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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 18:34 Gnat Problem - Freezing too soon russ lyttle
  2019-02-28 21:19 ` Anh Vo
@ 2019-02-28 21:22 ` Simon Wright
  2019-02-28 22:11   ` russ lyttle
  1 sibling, 1 reply; 22+ messages in thread
From: Simon Wright @ 2019-02-28 21:22 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

russ lyttle <lyttlec@removegmail.com> writes:

> Example from the bookAnalysable Real-Time Systems :
>
> 1  package Environment_Monitor.Ch4_Status is --Protected
> 2    protected type Methane_Agent (Ceiling : Priority)
> 3     with Priority => Ceiling
> 4       is new CH4_Safety
> 5    with
> 6      overriding function Check_Safe return Methane_Status;
> 7      overriding procedure Set_Safety (M : Methane_Status);
> 8    private
> 9       Current_Status : Methane_Status := Motor_Unsafe;
> 10   end Methane_Agent;
> 11 end Environment_Monitor.Ch4_Status;
>
> Gnat complains that Methane_Agent is frozen at line 2, and line 3 is
> trying to change an attribute after being frozen.

The resolution may well be to upgrade your compiler. GNAT GPL 2017 and
FSF GCC 8 are both happy with this compilable demonstrator:


[-- Attachment #2: demo --]
[-- Type: text/plain, Size: 1015 bytes --]

with System;
with Ada.Text_IO;
procedure Russ is

   package P is

      type Parent is synchronized interface;
      function Is_Safe (P : Parent) return Boolean is abstract;
      procedure Set_Safety (P : in out Parent; To : Boolean) is abstract;

      protected type Child (Ceiling : System.Priority)
      with Priority => Ceiling
      is new Parent with
         overriding
         function Is_Safe return Boolean;
         overriding
         procedure Set_Safety (To : Boolean);
      private
         Safety : Boolean := False;
      end Child;

   end P;

   package body P is

      protected body Child is
         function Is_Safe return Boolean is (Safety);
         procedure Set_Safety (To : Boolean) is
         begin
            Safety := To;
         end Set_Safety;
      end Child;

   end P;

   A_Child : P.Child (Ceiling => System.Priority'Last);

begin
   Ada.Text_IO.Put_Line (A_Child.Is_Safe'Img);
   A_Child.Set_Safety (True);
   Ada.Text_IO.Put_Line (A_Child.Is_Safe'Img);
end Russ;

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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 21:19 ` Anh Vo
@ 2019-02-28 21:31   ` russ lyttle
  0 siblings, 0 replies; 22+ messages in thread
From: russ lyttle @ 2019-02-28 21:31 UTC (permalink / raw)


On 2/28/19 4:19 PM, Anh Vo wrote:
> On Thursday, February 28, 2019 at 10:34:46 AM UTC-8, russ lyttle wrote:
>> Example from the bookAnalysable Real-Time Systems :
>>
>> 1  package Environment_Monitor.Ch4_Status is --Protected
>> 2    protected type Methane_Agent (Ceiling : Priority)
>> 3     with Priority => Ceiling
>> 4       is new CH4_Safety
>> 5    with
>> 6      overriding function Check_Safe return Methane_Status;
>> 7      overriding procedure Set_Safety (M : Methane_Status);
>> 8    private
>> 9       Current_Status : Methane_Status := Motor_Unsafe;
>> 10   end Methane_Agent;
>> 11 end Environment_Monitor.Ch4_Status;
>>
>> Gnat complains that Methane_Agent is frozen at line 2, and line 3 is
>> trying to change an attribute after being frozen.
>   
> I do not have this book. Could you post a minimally compile-able codes if not completed ones.
> 
> Anh Vo
> 
That is the entire environment_monitor-ch4_status.ads code. If line 2 is 
commented out, everything compiles and runs.

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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 21:22 ` Simon Wright
@ 2019-02-28 22:11   ` russ lyttle
  2019-03-01  0:49     ` Anh Vo
                       ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: russ lyttle @ 2019-02-28 22:11 UTC (permalink / raw)


On 2/28/19 4:22 PM, Simon Wright wrote:
> russ lyttle <lyttlec@removegmail.com> writes:
> 
>> Example from the bookAnalysable Real-Time Systems :
>>
>> 1  package Environment_Monitor.Ch4_Status is --Protected
>> 2    protected type Methane_Agent (Ceiling : Priority)
>> 3     with Priority => Ceiling
>> 4       is new CH4_Safety
>> 5    with
>> 6      overriding function Check_Safe return Methane_Status;
>> 7      overriding procedure Set_Safety (M : Methane_Status);
>> 8    private
>> 9       Current_Status : Methane_Status := Motor_Unsafe;
>> 10   end Methane_Agent;
>> 11 end Environment_Monitor.Ch4_Status;
>>
>> Gnat complains that Methane_Agent is frozen at line 2, and line 3 is
>> trying to change an attribute after being frozen.
> 
The resolution may well be to upgrade your compiler. GNAT GPL 2017 and
> FSF GCC 8 are both happy with this compilable demonstrator:
> 
> 
> with System;
> with Ada.Text_IO;
> procedure Russ is
> 
>     package P is
> 
>        type Parent is synchronized interface;
>        function Is_Safe (P : Parent) return Boolean is abstract;
>        procedure Set_Safety (P : in out Parent; To : Boolean) is abstract;
> 
>        protected type Child (Ceiling : System.Priority)
>        with Priority => Ceiling
>        is new Parent with
>           overriding
>           function Is_Safe return Boolean;
>           overriding
>           procedure Set_Safety (To : Boolean);
>        private
>           Safety : Boolean := False;
>        end Child;
> 
>     end P;
> 
>     package body P is
> 
>        protected body Child is
>           function Is_Safe return Boolean is (Safety);
>           procedure Set_Safety (To : Boolean) is
>           begin
>              Safety := To;
>           end Set_Safety;
>        end Child;
> 
>     end P;
> 
>     A_Child : P.Child (Ceiling => System.Priority'Last);
> 
> begin
>     Ada.Text_IO.Put_Line (A_Child.Is_Safe'Img);
>     A_Child.Set_Safety (True);
>     Ada.Text_IO.Put_Line (A_Child.Is_Safe'Img);
> end Russ;
> 
 > Running Ubuntu 18.10,
 > gcc --version is 8.2.0
 > gnat --version is 7.3.0

Ubuntu has version 7.3.0 as default and 8.2.0 as available.
I tried upgrading to gnat-8  (8.2.0) and package and 
Environment_Monitor.Ch4_Status now compiles fine. However, I now get this:

+=======================GNAT BUG DETECTED==============================+
| 8.2.0 (x86_64-linux-gnu) GCC error:                                      |
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:425                   |
| Error detected at sporadics.ads:44:23                                    |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

/media/russ/Projects/Ada/Analysable_RTS/Chap20/Common/sporadics.adb
/media/russ/Projects/Ada/Analysable_RTS/Chap20/Common/sporadics.ads

------------
 From sporadics.ads:

42   task type Sporadic (S : Any_Sporadic_State;
43		       A : Any_Sporadic_Thread_Interface)
44     with Priority => S.Pri is
45   end Sporadic;

Both of the above files compiled and and ran under gnat-7

The mine_control_system.gpr file is pretty simple:

project Mine_Control_System is
    for Source_Dirs use ("Common", "Data_Logger", "Environment_Monitor",
                         "Main", "Operator_Console", "Pump_Controller",
                         "Mine_Control_System"
                        );
    for Ignore_Source_Sub_Dirs use (".svn", "@*");
    for Object_Dir use "Obj";
    for Exec_Dir use ".";
    for Main use ("main.adb");


end Mine_Control_System;
----------

Would I be submitting a bug report against an already patched version of 
gnat?


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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 22:11   ` russ lyttle
@ 2019-03-01  0:49     ` Anh Vo
  2019-03-01 14:21       ` russ lyttle
  2019-03-01  8:12     ` Simon Wright
  2019-03-01 18:10     ` Simon Wright
  2 siblings, 1 reply; 22+ messages in thread
From: Anh Vo @ 2019-03-01  0:49 UTC (permalink / raw)


On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
> On 2/28/19 4:22 PM, Simon Wright wrote:
> > russ lyttle <lyttlec@removegmail.com> writes:
> > 
> >> Example from the bookAnalysable Real-Time Systems :
> >>
---------
> 
> Would I be submitting a bug report against an already patched version of 
> gnat?

Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
 

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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 22:11   ` russ lyttle
  2019-03-01  0:49     ` Anh Vo
@ 2019-03-01  8:12     ` Simon Wright
  2019-03-01 14:17       ` russ lyttle
  2019-03-01 18:10     ` Simon Wright
  2 siblings, 1 reply; 22+ messages in thread
From: Simon Wright @ 2019-03-01  8:12 UTC (permalink / raw)


russ lyttle <lyttlec@removegmail.com> writes:

> Would I be submitting a bug report against an already patched version
> of gnat?

No idea. But, if you do, *send the complete contents of the files*. As it
stands, all we can say is "huh?"


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

* Re: Gnat Problem - Freezing too soon
  2019-03-01  8:12     ` Simon Wright
@ 2019-03-01 14:17       ` russ lyttle
  0 siblings, 0 replies; 22+ messages in thread
From: russ lyttle @ 2019-03-01 14:17 UTC (permalink / raw)


On 3/1/19 3:12 AM, Simon Wright wrote:
> russ lyttle <lyttlec@removegmail.com> writes:
> 
>> Would I be submitting a bug report against an already patched version
>> of gnat?
> 
> No idea. But, if you do, *send the complete contents of the files*. As it
> stands, all we can say is "huh?"
> 
Zipped up the entire project as ubuntu gnat-7 gives one error and gnat-8 
another. It's from a text book so not very big.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-01  0:49     ` Anh Vo
@ 2019-03-01 14:21       ` russ lyttle
  2019-03-01 16:54         ` Anh Vo
  0 siblings, 1 reply; 22+ messages in thread
From: russ lyttle @ 2019-03-01 14:21 UTC (permalink / raw)


On 2/28/19 7:49 PM, Anh Vo wrote:
> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
>> On 2/28/19 4:22 PM, Simon Wright wrote:
>>> russ lyttle <lyttlec@removegmail.com> writes:
>>>
>>>> Example from the bookAnalysable Real-Time Systems :
>>>>
> ---------
>>
>> Would I be submitting a bug report against an already patched version of
>> gnat?
> 
> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
>   
> 
Thanks for responding. We found it definitely a bug in gnat and are 
submitting a bug report.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-01 14:21       ` russ lyttle
@ 2019-03-01 16:54         ` Anh Vo
  2019-03-01 21:50           ` russ lyttle
  0 siblings, 1 reply; 22+ messages in thread
From: Anh Vo @ 2019-03-01 16:54 UTC (permalink / raw)


On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
> On 2/28/19 7:49 PM, Anh Vo wrote:
> > On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
> >> On 2/28/19 4:22 PM, Simon Wright wrote:
> >>> russ lyttle <lyttlec@removegmail.com> writes:
> >>>
> >>>> Example from the bookAnalysable Real-Time Systems :
> >>>>
> > ---------
> >>
> >> Would I be submitting a bug report against an already patched version of
> >> gnat?
> > 
> > Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
> >   
> > 
> Thanks for responding. We found it definitely a bug in gnat and are 
> submitting a bug report.

It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
 

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

* Re: Gnat Problem - Freezing too soon
  2019-02-28 22:11   ` russ lyttle
  2019-03-01  0:49     ` Anh Vo
  2019-03-01  8:12     ` Simon Wright
@ 2019-03-01 18:10     ` Simon Wright
  2019-03-01 21:35       ` russ lyttle
  2 siblings, 1 reply; 22+ messages in thread
From: Simon Wright @ 2019-03-01 18:10 UTC (permalink / raw)


russ lyttle <lyttlec@removegmail.com> writes:

> +=======================GNAT BUG DETECTED==============================+
> | 8.2.0 (x86_64-linux-gnu) GCC error:                                      |
> | in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:425                   |
> | Error detected at sporadics.ads:44:23                                    |
> | Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
> | Use a subject line meaningful to you and us to track the bug.            |
> | Include the entire contents of this bug box in the report.               |
> | Include the exact command that you entered.                              |
> | Also include sources listed below.                                       |
> +==========================================================================+
>
> Please include these source files with error report
> Note that list may not be accurate in some cases,
> so please double check that the problem can still
> be reproduced with the set of files listed.
> Consider also -gnatd.n switch (see debug.adb).
>
> /media/russ/Projects/Ada/Analysable_RTS/Chap20/Common/sporadics.adb
> /media/russ/Projects/Ada/Analysable_RTS/Chap20/Common/sporadics.ads

There's no need to "confirm" this is a bug; an internal compiler error
like this is _always_ a bug. Whether reporting it is going to result in
any action isn't clear, it may be sufficiently unusual that no one else
is likely to encounter it. Or it may be the result of a failure to
detect a user error, in which case there may be a workround.

If you can demonstrate the same error using GNAT CE 2018, it's worth
reporting to report@adacore.com (GNAT in the subject line), which may
result in a fix in due course (but probably not for a while).

If you were to upload both the sources as requested in the bug box here,
we could try to help by checking later compiler releases or looking for
a workround.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-01 18:10     ` Simon Wright
@ 2019-03-01 21:35       ` russ lyttle
  0 siblings, 0 replies; 22+ messages in thread
From: russ lyttle @ 2019-03-01 21:35 UTC (permalink / raw)


On 3/1/19 1:10 PM, Simon Wright wrote:
> russ lyttle <lyttlec@removegmail.com> writes:
> 
>> +=======================GNAT BUG DETECTED==============================+
>> | 8.2.0 (x86_64-linux-gnu) GCC error:                                      |
>> | in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:425                   |
>> | Error detected at sporadics.ads:44:23                                    |
>> | Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
>> | Use a subject line meaningful to you and us to track the bug.            |
>> | Include the entire contents of this bug box in the report.               |
>> | Include the exact command that you entered.                              |
>> | Also include sources listed below.                                       |
>> +==========================================================================+
>>
>> Please include these source files with error report
>> Note that list may not be accurate in some cases,
>> so please double check that the problem can still
>> be reproduced with the set of files listed.
>> Consider also -gnatd.n switch (see debug.adb).
>>
>> /media/russ/Projects/Ada/Analysable_RTS/Chap20/Common/sporadics.adb
>> /media/russ/Projects/Ada/Analysable_RTS/Chap20/Common/sporadics.ads
> 
> There's no need to "confirm" this is a bug; an internal compiler error
> like this is _always_ a bug. Whether reporting it is going to result in
> any action isn't clear, it may be sufficiently unusual that no one else
> is likely to encounter it. Or it may be the result of a failure to
> detect a user error, in which case there may be a workround.
> 
> If you can demonstrate the same error using GNAT CE 2018, it's worth
> reporting to report@adacore.com (GNAT in the subject line), which may
> result in a fix in due course (but probably not for a while).
> 
> If you were to upload both the sources as requested in the bug box here,
> we could try to help by checking later compiler releases or looking for
> a workround.
> 
I downloaded from AdaCore early this morning and got the same results as 
with gnat-8 in Ubuntu. I've requested a login so I can post the bug, but 
haven't got a reply. Burns & Wellings use the same idiom several places. 
Results differ for task type, protected type, etc., but all similar 
types give the same result.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-01 16:54         ` Anh Vo
@ 2019-03-01 21:50           ` russ lyttle
  2019-03-02  1:08             ` Anh Vo
  2019-03-02 14:09             ` Simon Wright
  0 siblings, 2 replies; 22+ messages in thread
From: russ lyttle @ 2019-03-01 21:50 UTC (permalink / raw)


On 3/1/19 11:54 AM, Anh Vo wrote:
> On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
>> On 2/28/19 7:49 PM, Anh Vo wrote:
>>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
>>>> On 2/28/19 4:22 PM, Simon Wright wrote:
>>>>> russ lyttle <lyttlec@removegmail.com> writes:
>>>>>
>>>>>> Example from the bookAnalysable Real-Time Systems :
>>>>>>
>>> ---------
>>>>
>>>> Would I be submitting a bug report against an already patched version of
>>>> gnat?
>>>
>>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
>>>    
>>>
>> Thanks for responding. We found it definitely a bug in gnat and are
>> submitting a bug report.
> 
> It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
>   
> 
Here they are. These are from Analysable Real-Time Systems Progrmmed in 
Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44.

Full code for sporadics.ads:

with System; use System;
with Ada.Real_Time; use Ada.Real_Time;
package Sporadics is

    type Sporadic_Invoke_Interface is Synchronized Interface;
    procedure Start (S: in out Sporadic_Invoke_Interface)
       is abstract;
    type Any_Sporadic_Invoke_Interface is access all
      Sporadic_Invoke_Interface'Class;

    type Sporadic_Thread_Interface is Synchronized Interface;
    procedure Wait_Start (S: in out Sporadic_Thread_Interface)
       is abstract;
    type Any_Sporadic_Thread_Interface is access all
      Sporadic_Thread_Interface'Class;

    type Sporadic_State is abstract tagged
       record
	 Pri : Priority;
	 Ceiling_Priority : Priority;
	 MIT_In_Mili : Time_Span;
       end record;
    procedure Initialize_Code (S: in out Sporadic_State)
       is abstract;
    procedure Sporadic_Code (S: in out Sporadic_State)
       is abstract;
    type Any_Sporadic_State is access all Sporadic_State'Class;

    protected type Sporadic_Agent (S: Any_Sporadic_State)
      --with Priority => S.Ceiling_Prioriy
    is
       new Sporadic_Invoke_Interface and
           Sporadic_Thread_Interface
      with
      -- for the Start operation
      overriding procedure Start;
      overriding entry Wait_Start;
    private
       Start_Open : Boolean := False;
    end Sporadic_Agent;

    task type Sporadic (S : Any_Sporadic_State;
		       A : Any_Sporadic_Thread_Interface)
      with Priority => S.pri
        is

    end Sporadic;
end Sporadics;
-----------------------------------------------------------------------
Full code for sporadics.adb:
package body Sporadics is
    protected body Sporadic_Agent is
       procedure Start is
       begin
	 Start_Open := False;
       end Start;

       entry Wait_Start
       when Start_Open is
       begin
	 Start_Open := False;
       end Wait_Start;
    end Sporadic_Agent;

       task body Sporadic is
       begin
	 S.Initialize_Code;
	 loop
	    A.Wait_Start;
	    S.Sporadic_Code;
	 end loop;
       end Sporadic;
    end Sporadics;

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

* Re: Gnat Problem - Freezing too soon
  2019-03-01 21:50           ` russ lyttle
@ 2019-03-02  1:08             ` Anh Vo
  2019-03-02  3:55               ` russ lyttle
  2019-03-02 14:09             ` Simon Wright
  1 sibling, 1 reply; 22+ messages in thread
From: Anh Vo @ 2019-03-02  1:08 UTC (permalink / raw)


On Friday, March 1, 2019 at 1:50:12 PM UTC-8, russ lyttle wrote:
> On 3/1/19 11:54 AM, Anh Vo wrote:
> > On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
> >> On 2/28/19 7:49 PM, Anh Vo wrote:
> >>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
> >>>> On 2/28/19 4:22 PM, Simon Wright wrote:
> >>>>> russ lyttle <lyttlec@removegmail.com> writes:
> >>>>>
> >>>>>> Example from the bookAnalysable Real-Time Systems :
> >>>>>>
> >>> ---------
> >>>>
> >>>> Would I be submitting a bug report against an already patched version of
> >>>> gnat?
> >>>
> >>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
> >>>    
> >>>
> >> Thanks for responding. We found it definitely a bug in gnat and are
> >> submitting a bug report.
> > 
> > It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
> >   
> > 
> Here they are. These are from Analysable Real-Time Systems Progrmmed in 
> Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44.
> 
> Full code for sporadics.ads:
> 
> with System; use System;
> with Ada.Real_Time; use Ada.Real_Time;
> package Sporadics is
> 
>     type Sporadic_Invoke_Interface is Synchronized Interface;
>     procedure Start (S: in out Sporadic_Invoke_Interface)
>        is abstract;
>     type Any_Sporadic_Invoke_Interface is access all
>       Sporadic_Invoke_Interface'Class;
> 
>     type Sporadic_Thread_Interface is Synchronized Interface;
>     procedure Wait_Start (S: in out Sporadic_Thread_Interface)
>        is abstract;
>     type Any_Sporadic_Thread_Interface is access all
>       Sporadic_Thread_Interface'Class;
> 
>     type Sporadic_State is abstract tagged
>        record
> 	 Pri : Priority;
> 	 Ceiling_Priority : Priority;
> 	 MIT_In_Mili : Time_Span;
>        end record;
>     procedure Initialize_Code (S: in out Sporadic_State)
>        is abstract;
>     procedure Sporadic_Code (S: in out Sporadic_State)
>        is abstract;
>     type Any_Sporadic_State is access all Sporadic_State'Class;
> 
>     protected type Sporadic_Agent (S: Any_Sporadic_State)
>       --with Priority => S.Ceiling_Prioriy
>     is
>        new Sporadic_Invoke_Interface and
>            Sporadic_Thread_Interface
>       with
>       -- for the Start operation
>       overriding procedure Start;
>       overriding entry Wait_Start;
>     private
>        Start_Open : Boolean := False;
>     end Sporadic_Agent;
> 
>     task type Sporadic (S : Any_Sporadic_State;
> 		       A : Any_Sporadic_Thread_Interface)
>       with Priority => S.pri
>         is
> 
>     end Sporadic;
> end Sporadics;
> -----------------------------------------------------------------------
> Full code for sporadics.adb:
> package body Sporadics is
>     protected body Sporadic_Agent is
>        procedure Start is
>        begin
> 	 Start_Open := False;
>        end Start;
> 
>        entry Wait_Start
>        when Start_Open is
>        begin
> 	 Start_Open := False;
>        end Wait_Start;
>     end Sporadic_Agent;
> 
>        task body Sporadic is
>        begin
> 	 S.Initialize_Code;
> 	 loop
> 	    A.Wait_Start;
> 	    S.Sporadic_Code;
> 	 end loop;
>        end Sporadic;
>     end Sporadics;

This problem also occurred with GNAT Community 2018 on Windows.

While waiting for fixes in GNAT Community 2019, the work around is changing the definition of type Any_Sporadic_State as shown below.

    type Any_Sporadic_State is not null access all Sporadic_State'Class;


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

* Re: Gnat Problem - Freezing too soon
  2019-03-02  1:08             ` Anh Vo
@ 2019-03-02  3:55               ` russ lyttle
  2019-03-02  5:50                 ` Anh Vo
  0 siblings, 1 reply; 22+ messages in thread
From: russ lyttle @ 2019-03-02  3:55 UTC (permalink / raw)


On 3/1/19 8:08 PM, Anh Vo wrote:
> On Friday, March 1, 2019 at 1:50:12 PM UTC-8, russ lyttle wrote:
>> On 3/1/19 11:54 AM, Anh Vo wrote:
>>> On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
>>>> On 2/28/19 7:49 PM, Anh Vo wrote:
>>>>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
>>>>>> On 2/28/19 4:22 PM, Simon Wright wrote:
>>>>>>> russ lyttle <lyttlec@removegmail.com> writes:
>>>>>>>
>>>>>>>> Example from the bookAnalysable Real-Time Systems :
>>>>>>>>
>>>>> ---------
>>>>>>
>>>>>> Would I be submitting a bug report against an already patched version of
>>>>>> gnat?
>>>>>
>>>>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
>>>>>     
>>>>>
>>>> Thanks for responding. We found it definitely a bug in gnat and are
>>>> submitting a bug report.
>>>
>>> It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
>>>    
>>>
>> Here they are. These are from Analysable Real-Time Systems Progrmmed in
>> Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44.
>>
>> Full code for sporadics.ads:
>>
>> with System; use System;
>> with Ada.Real_Time; use Ada.Real_Time;
>> package Sporadics is
>>
>>      type Sporadic_Invoke_Interface is Synchronized Interface;
>>      procedure Start (S: in out Sporadic_Invoke_Interface)
>>         is abstract;
>>      type Any_Sporadic_Invoke_Interface is access all
>>        Sporadic_Invoke_Interface'Class;
>>
>>      type Sporadic_Thread_Interface is Synchronized Interface;
>>      procedure Wait_Start (S: in out Sporadic_Thread_Interface)
>>         is abstract;
>>      type Any_Sporadic_Thread_Interface is access all
>>        Sporadic_Thread_Interface'Class;
>>
>>      type Sporadic_State is abstract tagged
>>         record
>> 	 Pri : Priority;
>> 	 Ceiling_Priority : Priority;
>> 	 MIT_In_Mili : Time_Span;
>>         end record;
>>      procedure Initialize_Code (S: in out Sporadic_State)
>>         is abstract;
>>      procedure Sporadic_Code (S: in out Sporadic_State)
>>         is abstract;
>>      type Any_Sporadic_State is access all Sporadic_State'Class;
>>
>>      protected type Sporadic_Agent (S: Any_Sporadic_State)
>>        --with Priority => S.Ceiling_Prioriy
>>      is
>>         new Sporadic_Invoke_Interface and
>>             Sporadic_Thread_Interface
>>        with
>>        -- for the Start operation
>>        overriding procedure Start;
>>        overriding entry Wait_Start;
>>      private
>>         Start_Open : Boolean := False;
>>      end Sporadic_Agent;
>>
>>      task type Sporadic (S : Any_Sporadic_State;
>> 		       A : Any_Sporadic_Thread_Interface)
>>        with Priority => S.pri
>>          is
>>
>>      end Sporadic;
>> end Sporadics;
>> -----------------------------------------------------------------------
>> Full code for sporadics.adb:
>> package body Sporadics is
>>      protected body Sporadic_Agent is
>>         procedure Start is
>>         begin
>> 	 Start_Open := False;
>>         end Start;
>>
>>         entry Wait_Start
>>         when Start_Open is
>>         begin
>> 	 Start_Open := False;
>>         end Wait_Start;
>>      end Sporadic_Agent;
>>
>>         task body Sporadic is
>>         begin
>> 	 S.Initialize_Code;
>> 	 loop
>> 	    A.Wait_Start;
>> 	    S.Sporadic_Code;
>> 	 end loop;
>>         end Sporadic;
>>      end Sporadics;
> 
> This problem also occurred with GNAT Community 2018 on Windows.
> 
> While waiting for fixes in GNAT Community 2019, the work around is changing the definition of type Any_Sporadic_State as shown below.
> 
>      type Any_Sporadic_State is not null access all Sporadic_State'Class;
> 
Well, that worked. I may even come to understand why. Is this gnat only?


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

* Re: Gnat Problem - Freezing too soon
  2019-03-02  3:55               ` russ lyttle
@ 2019-03-02  5:50                 ` Anh Vo
  2019-03-02 20:19                   ` russ lyttle
  0 siblings, 1 reply; 22+ messages in thread
From: Anh Vo @ 2019-03-02  5:50 UTC (permalink / raw)


On Friday, March 1, 2019 at 7:56:40 PM UTC-8, russ lyttle wrote:
> On 3/1/19 8:08 PM, Anh Vo wrote:
> > On Friday, March 1, 2019 at 1:50:12 PM UTC-8, russ lyttle wrote:
> >> On 3/1/19 11:54 AM, Anh Vo wrote:
> >>> On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
> >>>> On 2/28/19 7:49 PM, Anh Vo wrote:
> >>>>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
> >>>>>> On 2/28/19 4:22 PM, Simon Wright wrote:
> >>>>>>> russ lyttle <lyttlec@removegmail.com> writes:
> >>>>>>>
> >>>>>>>> Example from the bookAnalysable Real-Time Systems :
> >>>>>>>>
> >>>>> ---------
> >>>>>>
> >>>>>> Would I be submitting a bug report against an already patched version of
> >>>>>> gnat?
> >>>>>
> >>>>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
> >>>>>     
> >>>>>
> >>>> Thanks for responding. We found it definitely a bug in gnat and are
> >>>> submitting a bug report.
> >>>
> >>> It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
> >>>    
> >>>
> >> Here they are. These are from Analysable Real-Time Systems Progrmmed in
> >> Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44.
> >>
> >> Full code for sporadics.ads:
> >>
> >> with System; use System;
> >> with Ada.Real_Time; use Ada.Real_Time;
> >> package Sporadics is
> >>
> >>      type Sporadic_Invoke_Interface is Synchronized Interface;
> >>      procedure Start (S: in out Sporadic_Invoke_Interface)
> >>         is abstract;
> >>      type Any_Sporadic_Invoke_Interface is access all
> >>        Sporadic_Invoke_Interface'Class;
> >>
> >>      type Sporadic_Thread_Interface is Synchronized Interface;
> >>      procedure Wait_Start (S: in out Sporadic_Thread_Interface)
> >>         is abstract;
> >>      type Any_Sporadic_Thread_Interface is access all
> >>        Sporadic_Thread_Interface'Class;
> >>
> >>      type Sporadic_State is abstract tagged
> >>         record
> >> 	 Pri : Priority;
> >> 	 Ceiling_Priority : Priority;
> >> 	 MIT_In_Mili : Time_Span;
> >>         end record;
> >>      procedure Initialize_Code (S: in out Sporadic_State)
> >>         is abstract;
> >>      procedure Sporadic_Code (S: in out Sporadic_State)
> >>         is abstract;
> >>      type Any_Sporadic_State is access all Sporadic_State'Class;
> >>
> >>      protected type Sporadic_Agent (S: Any_Sporadic_State)
> >>        --with Priority => S.Ceiling_Prioriy
> >>      is
> >>         new Sporadic_Invoke_Interface and
> >>             Sporadic_Thread_Interface
> >>        with
> >>        -- for the Start operation
> >>        overriding procedure Start;
> >>        overriding entry Wait_Start;
> >>      private
> >>         Start_Open : Boolean := False;
> >>      end Sporadic_Agent;
> >>
> >>      task type Sporadic (S : Any_Sporadic_State;
> >> 		       A : Any_Sporadic_Thread_Interface)
> >>        with Priority => S.pri
> >>          is
> >>
> >>      end Sporadic;
> >> end Sporadics;
> >> -----------------------------------------------------------------------
> >> Full code for sporadics.adb:
> >> package body Sporadics is
> >>      protected body Sporadic_Agent is
> >>         procedure Start is
> >>         begin
> >> 	 Start_Open := False;
> >>         end Start;
> >>
> >>         entry Wait_Start
> >>         when Start_Open is
> >>         begin
> >> 	 Start_Open := False;
> >>         end Wait_Start;
> >>      end Sporadic_Agent;
> >>
> >>         task body Sporadic is
> >>         begin
> >> 	 S.Initialize_Code;
> >> 	 loop
> >> 	    A.Wait_Start;
> >> 	    S.Sporadic_Code;
> >> 	 end loop;
> >>         end Sporadic;
> >>      end Sporadics;
> > 
> > This problem also occurred with GNAT Community 2018 on Windows.
> > 
> > While waiting for fixes in GNAT Community 2019, the work around is changing the definition of type Any_Sporadic_State as shown below.
> > 
> >      type Any_Sporadic_State is not null access all Sporadic_State'Class;
> > 
> Well, that worked. I may even come to understand why. Is this gnat only?

It is standard Ada. It means that the access variable must be not null.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-01 21:50           ` russ lyttle
  2019-03-02  1:08             ` Anh Vo
@ 2019-03-02 14:09             ` Simon Wright
  1 sibling, 0 replies; 22+ messages in thread
From: Simon Wright @ 2019-03-02 14:09 UTC (permalink / raw)


The code is accepted by GCC 9 as it is.

For GNAT CE 2018, I found it worked to replace the Priority aspects with
pragmas.

Implementing all the aspects, new to Ada 2012, is still a work in progress.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-02  5:50                 ` Anh Vo
@ 2019-03-02 20:19                   ` russ lyttle
  2019-03-02 21:35                     ` Simon Wright
  0 siblings, 1 reply; 22+ messages in thread
From: russ lyttle @ 2019-03-02 20:19 UTC (permalink / raw)


On 3/2/19 12:50 AM, Anh Vo wrote:
> On Friday, March 1, 2019 at 7:56:40 PM UTC-8, russ lyttle wrote:
>> On 3/1/19 8:08 PM, Anh Vo wrote:
>>> On Friday, March 1, 2019 at 1:50:12 PM UTC-8, russ lyttle wrote:
>>>> On 3/1/19 11:54 AM, Anh Vo wrote:
>>>>> On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
>>>>>> On 2/28/19 7:49 PM, Anh Vo wrote:
>>>>>>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
>>>>>>>> On 2/28/19 4:22 PM, Simon Wright wrote:
>>>>>>>>> russ lyttle <lyttlec@removegmail.com> writes:
>>>>>>>>>
>>>>>>>>>> Example from the bookAnalysable Real-Time Systems :
>>>>>>>>>>
>>>>>>> ---------
>>>>>>>>
>>>>>>>> Would I be submitting a bug report against an already patched version of
>>>>>>>> gnat?
>>>>>>>
>>>>>>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
>>>>>>>      
>>>>>>>
>>>>>> Thanks for responding. We found it definitely a bug in gnat and are
>>>>>> submitting a bug report.
>>>>>
>>>>> It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
>>>>>     
>>>>>
>>>> Here they are. These are from Analysable Real-Time Systems Progrmmed in
>>>> Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44.
>>>>
>>>> Full code for sporadics.ads:
>>>>
>>>> with System; use System;
>>>> with Ada.Real_Time; use Ada.Real_Time;
>>>> package Sporadics is
>>>>
>>>>       type Sporadic_Invoke_Interface is Synchronized Interface;
>>>>       procedure Start (S: in out Sporadic_Invoke_Interface)
>>>>          is abstract;
>>>>       type Any_Sporadic_Invoke_Interface is access all
>>>>         Sporadic_Invoke_Interface'Class;
>>>>
>>>>       type Sporadic_Thread_Interface is Synchronized Interface;
>>>>       procedure Wait_Start (S: in out Sporadic_Thread_Interface)
>>>>          is abstract;
>>>>       type Any_Sporadic_Thread_Interface is access all
>>>>         Sporadic_Thread_Interface'Class;
>>>>
>>>>       type Sporadic_State is abstract tagged
>>>>          record
>>>> 	 Pri : Priority;
>>>> 	 Ceiling_Priority : Priority;
>>>> 	 MIT_In_Mili : Time_Span;
>>>>          end record;
>>>>       procedure Initialize_Code (S: in out Sporadic_State)
>>>>          is abstract;
>>>>       procedure Sporadic_Code (S: in out Sporadic_State)
>>>>          is abstract;
>>>>       type Any_Sporadic_State is access all Sporadic_State'Class;
>>>>
>>>>       protected type Sporadic_Agent (S: Any_Sporadic_State)
>>>>         --with Priority => S.Ceiling_Prioriy
>>>>       is
>>>>          new Sporadic_Invoke_Interface and
>>>>              Sporadic_Thread_Interface
>>>>         with
>>>>         -- for the Start operation
>>>>         overriding procedure Start;
>>>>         overriding entry Wait_Start;
>>>>       private
>>>>          Start_Open : Boolean := False;
>>>>       end Sporadic_Agent;
>>>>
>>>>       task type Sporadic (S : Any_Sporadic_State;
>>>> 		       A : Any_Sporadic_Thread_Interface)
>>>>         with Priority => S.pri
>>>>           is
>>>>
>>>>       end Sporadic;
>>>> end Sporadics;
>>>> -----------------------------------------------------------------------
>>>> Full code for sporadics.adb:
>>>> package body Sporadics is
>>>>       protected body Sporadic_Agent is
>>>>          procedure Start is
>>>>          begin
>>>> 	 Start_Open := False;
>>>>          end Start;
>>>>
>>>>          entry Wait_Start
>>>>          when Start_Open is
>>>>          begin
>>>> 	 Start_Open := False;
>>>>          end Wait_Start;
>>>>       end Sporadic_Agent;
>>>>
>>>>          task body Sporadic is
>>>>          begin
>>>> 	 S.Initialize_Code;
>>>> 	 loop
>>>> 	    A.Wait_Start;
>>>> 	    S.Sporadic_Code;
>>>> 	 end loop;
>>>>          end Sporadic;
>>>>       end Sporadics;
>>>
>>> This problem also occurred with GNAT Community 2018 on Windows.
>>>
>>> While waiting for fixes in GNAT Community 2019, the work around is changing the definition of type Any_Sporadic_State as shown below.
>>>
>>>       type Any_Sporadic_State is not null access all Sporadic_State'Class;
>>>
>> Well, that worked. I may even come to understand why. Is this gnat only?
> 
> It is standard Ada. It means that the access variable must be not null.
> 
I understand that. I meant why it solved this particular problem. As far 
as I can tell, the authors never used the "not null" in any of their 
books. Would other compilers accept the code as written, or should the 
code be considered erroneous?
As Simon pointed out replacing "with Priority => S.pri" with "pragma 
Priority(S.pri)" also works. They never used that form either.

Why would the authors prefer one form over the others?


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

* Re: Gnat Problem - Freezing too soon
  2019-03-02 20:19                   ` russ lyttle
@ 2019-03-02 21:35                     ` Simon Wright
  2019-03-03 20:42                       ` russ lyttle
  0 siblings, 1 reply; 22+ messages in thread
From: Simon Wright @ 2019-03-02 21:35 UTC (permalink / raw)


russ lyttle <lyttlec@removegmail.com> writes:

> I meant why it solved this particular problem. As far as I can tell,
> the authors never used the "not null" in any of their books. Would
> other compilers accept the code as written, or should the code be
> considered erroneous?

'not null' is clearly better style.

With regard to

   task type Sporadic (S : Any_Sporadic_State;
		       A : Any_Sporadic_Thread_Interface)
   with Priority => S.pri
   is

GNAT CE 2018 fails, GNAT GPL 2017 & earlier & GCC 9 succeed. You can see
that making the type 'not null' would eliminate a check (check would be
done at the call site instead), so that the internal tree generated by
the compiler would be different, and the compiler may have been changed
in this region for other reasons.

With regard to

   protected type Sporadic_Agent (S: Any_Sporadic_State)
   with Priority => S.Ceiling_Prioriy
   is

all the compilers are seriously confused:

   sporadics.ada:30:22: no selector "Ceiling_Prioriy" for type "Sporadic_State'Class" defined at line 17
   sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
   sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
   sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"

and you only have to look at the task equivalent above to see that it
should have been OK. This one looks like another compiler error to me.

> As Simon pointed out replacing "with Priority => S.pri" with "pragma
> Priority(S.pri)" also works. They never used that form either.
>
> Why would the authors prefer one form over the others?

The aspect is the newer form; the book was published in 2016, so they'd
have gone with that.

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

* Re: Gnat Problem - Freezing too soon
  2019-03-02 21:35                     ` Simon Wright
@ 2019-03-03 20:42                       ` russ lyttle
  2019-03-03 21:26                         ` Simon Wright
  0 siblings, 1 reply; 22+ messages in thread
From: russ lyttle @ 2019-03-03 20:42 UTC (permalink / raw)


On 3/2/19 4:35 PM, Simon Wright wrote:
> russ lyttle <lyttlec@removegmail.com> writes:
> 
>> I meant why it solved this particular problem. As far as I can tell,
>> the authors never used the "not null" in any of their books. Would
>> other compilers accept the code as written, or should the code be
>> considered erroneous?
> 
> 'not null' is clearly better style.
> 
> With regard to
> 
>     task type Sporadic (S : Any_Sporadic_State;
> 		       A : Any_Sporadic_Thread_Interface)
>     with Priority => S.pri
>     is
> 
> GNAT CE 2018 fails, GNAT GPL 2017 & earlier & GCC 9 succeed. You can see
> that making the type 'not null' would eliminate a check (check would be
> done at the call site instead), so that the internal tree generated by
> the compiler would be different, and the compiler may have been changed
> in this region for other reasons.
> 
> With regard to
> 
>     protected type Sporadic_Agent (S: Any_Sporadic_State)
>     with Priority => S.Ceiling_Prioriy
>     is
> 
> all the compilers are seriously confused:
> 
>     sporadics.ada:30:22: no selector "Ceiling_Prioriy" for type "Sporadic_State'Class" defined at line 17
>     sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>     sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>     sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
> 
> and you only have to look at the task equivalent above to see that it
> should have been OK. This one looks like another compiler error to me.
> 
There is a misspelling: Prioriy => Priority. Correct that misspelling 
and the idiom _sometimes_ works without the "not null". The bug report 
had an instance of where the compiler failed. Would it be helpful to add 
an instance where it passed?

>> As Simon pointed out replacing "with Priority => S.pri" with "pragma
>> Priority(S.pri)" also works. They never used that form either.
>>
>> Why would the authors prefer one form over the others?
> 
> The aspect is the newer form; the book was published in 2016, so they'd
> have gone with that.
> 
That's a good reason :)

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

* Re: Gnat Problem - Freezing too soon
  2019-03-03 20:42                       ` russ lyttle
@ 2019-03-03 21:26                         ` Simon Wright
  2019-03-04  0:33                           ` russ lyttle
  0 siblings, 1 reply; 22+ messages in thread
From: Simon Wright @ 2019-03-03 21:26 UTC (permalink / raw)


russ lyttle <lyttlec@removegmail.com> writes:

> On 3/2/19 4:35 PM, Simon Wright wrote:

>> With regard to
>>
>>     protected type Sporadic_Agent (S: Any_Sporadic_State)
>>     with Priority => S.Ceiling_Prioriy
>>     is
>>
>> all the compilers are seriously confused:
>>
>>     sporadics.ada:30:22: no selector "Ceiling_Prioriy" for type "Sporadic_State'Class" defined at line 17
>>     sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>>     sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>>     sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>>
>> and you only have to look at the task equivalent above to see that it
>> should have been OK. This one looks like another compiler error to me.
>>
> There is a misspelling: Prioriy => Priority. Correct that misspelling
> and the idiom _sometimes_ works without the "not null".

Oh dear. Colour _me_ confused.

> The bug report had an instance of where the compiler failed. Would it
> be helpful to add an instance where it passed?

Maybe so, I read once that the experts 'merely' fire up the compiler
under the debugger and go straight to the source of the problem. Scary.
That said, I don't see that it could hurt.


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

* Re: Gnat Problem - Freezing too soon
  2019-03-03 21:26                         ` Simon Wright
@ 2019-03-04  0:33                           ` russ lyttle
  0 siblings, 0 replies; 22+ messages in thread
From: russ lyttle @ 2019-03-04  0:33 UTC (permalink / raw)


On 3/3/19 4:26 PM, Simon Wright wrote:
> russ lyttle <lyttlec@removegmail.com> writes:
> 
>> On 3/2/19 4:35 PM, Simon Wright wrote:
> 
>>> With regard to
>>>
>>>      protected type Sporadic_Agent (S: Any_Sporadic_State)
>>>      with Priority => S.Ceiling_Prioriy
>>>      is
>>>
>>> all the compilers are seriously confused:
>>>
>>>      sporadics.ada:30:22: no selector "Ceiling_Prioriy" for type "Sporadic_State'Class" defined at line 17
>>>      sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>>>      sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>>>      sporadics.ada:30:23: possible misspelling of "Ceiling_Priority"
>>>
>>> and you only have to look at the task equivalent above to see that it
>>> should have been OK. This one looks like another compiler error to me.
>>>
>> There is a misspelling: Prioriy => Priority. Correct that misspelling
>> and the idiom _sometimes_ works without the "not null".
> 
> Oh dear. Colour _me_ confused.
> 
>> The bug report had an instance of where the compiler failed. Would it
>> be helpful to add an instance where it passed?
> 
> Maybe so, I read once that the experts 'merely' fire up the compiler
> under the debugger and go straight to the source of the problem. Scary.
> That said, I don't see that it could hurt.
>   It looks like it was two separate bugs involving "with Priority". One 
was fixed, but a new one introduced. "not null" fixes the new one.

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

end of thread, other threads:[~2019-03-04  0:33 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 18:34 Gnat Problem - Freezing too soon russ lyttle
2019-02-28 21:19 ` Anh Vo
2019-02-28 21:31   ` russ lyttle
2019-02-28 21:22 ` Simon Wright
2019-02-28 22:11   ` russ lyttle
2019-03-01  0:49     ` Anh Vo
2019-03-01 14:21       ` russ lyttle
2019-03-01 16:54         ` Anh Vo
2019-03-01 21:50           ` russ lyttle
2019-03-02  1:08             ` Anh Vo
2019-03-02  3:55               ` russ lyttle
2019-03-02  5:50                 ` Anh Vo
2019-03-02 20:19                   ` russ lyttle
2019-03-02 21:35                     ` Simon Wright
2019-03-03 20:42                       ` russ lyttle
2019-03-03 21:26                         ` Simon Wright
2019-03-04  0:33                           ` russ lyttle
2019-03-02 14:09             ` Simon Wright
2019-03-01  8:12     ` Simon Wright
2019-03-01 14:17       ` russ lyttle
2019-03-01 18:10     ` Simon Wright
2019-03-01 21:35       ` russ lyttle

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