comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: gnoga build fails on Mac
Date: Tue, 30 Jun 2020 20:09:35 -0500	[thread overview]
Message-ID: <rdgnog$ej7$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: rdc8p2$u5v$1@dont-email.me

"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message 
news:rdc8p2$u5v$1@dont-email.me...
> On 6/29/20 2:55 AM, Randy Brukardt wrote:
>> "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message
>> news:rcq55l$r03$1@dont-email.me...
>>> On 6/22/20 7:56 AM, Dmitry A. Kazakov wrote:
>>>> On 22/06/2020 05:15, Roger wrote:
>>>>>
>>>>> demo/db_maker/movies.adb
>>>>> "equality operator must be declared before type "Movie_Info" is frozen
>>>>> (RM 4.5.2 (9.8)) (Ada 2012)"
>>>>
>>>> That looks like a compiler bug to me.
>>>
>>> I agree. What happens if you change "=" from an expression function to a
>>> regular function?
>>
>> It is illegal either way. This was an incompatible change in Ada 2012; it
>> stems from the fact that "=" of untagged records composes in Ada 2012 but
>> not in earlier versions of Ada. Composition cannot be view dependent, and 
>> as
>> such we cannot allow "late" declarations of operators where some users 
>> would
>> not see the redefined operator.
>
> The declaration of "=" is the first declaration after the type declaration 
> in a procedure. How can it be "late"? What users might not see the 
> operator?

I based my comment on the error message; I did not look at the code. The 
message says (correctly) that "=" must be declared before the type 
Movie_Info is frozen. Ada 83 has some stupid rules allowing "late" 
declarations of operators that do not override the usual operators. One 
cannot allow that to happen for record "=". (It shouldn't be allowed ever, 
but it is one stupid rule that we're stuck with.)

I suppose there could be a compiler bug if Movie_Info is prematurely frozen, 
but I suspect it is much more likely that the code is illegal. GNAT didn't 
enforce this rule until recently (it has recently been catching up with 
newer ACATS tests for newer incompatible rules), so I find it likely that 
the code is wrong.

                                  Randy.


  reply	other threads:[~2020-07-01  1:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21  7:57 gnoga build fails on Mac Roger
2020-06-21  8:41 ` Dmitry A. Kazakov
2020-06-21 11:18   ` Roger
2020-06-21 13:28     ` Dmitry A. Kazakov
2020-06-22  3:15       ` Roger
2020-06-22  5:56         ` Dmitry A. Kazakov
2020-06-22  6:14           ` Roger
2020-06-22 11:37           ` Jeffrey R. Carter
2020-06-22 23:25             ` Roger
2020-06-23 11:27               ` Jeffrey R. Carter
2020-06-29  0:55             ` Randy Brukardt
2020-06-29  8:29               ` Jeffrey R. Carter
2020-07-01  1:09                 ` Randy Brukardt [this message]
2020-07-01  8:52                   ` Jeffrey R. Carter
2020-07-03  0:23                     ` Randy Brukardt
2020-07-03  9:09                       ` Jeffrey R. Carter
2020-07-07 14:41                         ` Shark8
2020-07-07 15:37                           ` Jeffrey R. Carter
2020-06-21 14:24 ` Jeffrey R. Carter
2020-06-21 16:46   ` Simon Wright
replies disabled

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