comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: A smaller self contained test case. Was: Compiler Bug or what I'm doing wrong?
Date: Sat, 24 Jun 2006 14:52:37 +0200
Date: 2006-06-24T14:52:37+02:00	[thread overview]
Message-ID: <c5paw9scdby3$.pkiyaxbz33dp.dlg@40tude.net> (raw)
In-Reply-To: 7sr71erb6j.fsf@hod.lan.m-e-leypold.de

On 24 Jun 2006 14:27:16 +0200, M E Leypold wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> ARM 13.13.2 (9) reads:
>> 
>>    "If T is a discriminated type, discriminants are included only if they
>> have defaults."
> 
> I understood it like this: If the discrimant has defaults the type is
> definite (translate that as "has fixed memory allocation
> requirements"). Then 'Read is expected to handle the type. Else (no
> default discriminant) the type is indefinite ("no fixed memory
> allocation requirement") and 'Input would be the appropriate function
> to read from a Stream, but it would essentially read the discriminats,
> allocate memory and then invoke 'Read. 

Input is always appropriate, Read only if constraints are fixed during
object life time [informally].

BTW, I wouldn't use discriminants with defaults, and in any case, would use
Input for them. Further, in this particular case, I'd expect Read be less
effective than Input:

1. You have the discriminant stored anyway (that was the choice about
having the defaults), so you cannot use one stored value of the
discriminant for all 400 fields, even if they had it same.

2. Read means that you have one extra initialize / finalize pair. Input
does not:

declare
   X : Foo renames Foo'Input (S); -- Initializes only once
begin

[...]
> The hypothesis that the wrong finalizers are being run could be tested
> of course (by using a custom controlled type), but I haven't done it
> yet (fixing my application or getting a new Gnat as obviously
> priority).

My experience with GNAT tells me: slowly, don't hurry. You never know which
new bug it could have. (:-()

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2006-06-24 12:52 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 16:56 Compiler Bug or what I'm doing wrong? M E Leypold
2006-06-21  7:44 ` Ludovic Brenta
2006-06-21 12:29   ` M E Leypold
2006-06-21 12:46     ` Alex R. Mosteo
2006-06-21 13:23       ` M E Leypold
2006-06-22 19:10         ` Simon Wright
2006-06-23  8:24         ` Ludovic Brenta
2006-06-23 13:14         ` Alex R. Mosteo
2006-06-23 13:24           ` Alex R. Mosteo
2006-06-24 20:33             ` Simon Wright
2006-06-24 20:56               ` M E Leypold
2006-06-26  7:32                 ` Ludovic Brenta
2006-06-26 11:16                   ` M E Leypold
2006-06-26 12:13                     ` [Ada in Debian] GtkAda and GNAT versions Ludovic Brenta
2006-06-26 12:25                       ` M E Leypold
2006-06-27 20:55                   ` Compiler Bug or what I'm doing wrong? Simon Wright
2006-06-27 22:26                     ` Ludovic Brenta
2006-06-22  2:07       ` James Dennett
2006-06-22  6:37         ` Duncan Sands
2006-06-22 16:53           ` M E Leypold
2006-06-22 19:01             ` Pascal Obry
2006-06-23  8:37               ` M E Leypold
2006-06-22 19:05             ` Dmitry A. Kazakov
2006-06-23  4:47               ` Jeffrey R. Carter
2006-06-23 12:26               ` Stephen Leake
2006-06-23 13:11                 ` Dmitry A. Kazakov
2006-06-23 13:15                 ` Alex R. Mosteo
2006-06-23  9:55 ` A smaller self contained test case. Was: " M E Leypold
2006-06-23 10:03   ` M E Leypold
2006-06-23 11:04   ` And a Workaround: Was: A smaller test case / Compiler Bug M E Leypold
2006-06-23 11:12     ` Possible memory leaks when reading/writing variant records M E Leypold
2006-06-24 11:46   ` A smaller self contained test case. Was: Compiler Bug or what I'm doing wrong? Dmitry A. Kazakov
2006-06-24 12:27     ` M E Leypold
2006-06-24 12:52       ` Dmitry A. Kazakov [this message]
2006-06-24 13:53         ` M E Leypold
2006-06-24 19:58           ` Dmitry A. Kazakov
2006-06-24 20:22             ` M E Leypold
2006-06-25  7:59               ` Dmitry A. Kazakov
2006-06-25 10:51                 ` M E Leypold
2006-06-26  6:22                   ` Martin Dowie
2006-06-24 21:21             ` M E Leypold
2006-06-25 21:36   ` M E Leypold
2006-06-26 21:53   ` Possibly fixed in gcc 4.1.1, but bug box -- Was: Re: A smaller self contained test case M E Leypold
2006-06-27 18:24     ` Alex R. Mosteo
2006-06-27 22:58       ` M E Leypold
2006-06-28 10:32         ` Alex R. Mosteo
2006-07-03  1:38         ` Steve Whalen
2006-07-03 10:36           ` M E Leypold
2006-06-28  8:41       ` Ludovic Brenta
2006-06-28  8:51         ` Georg Bauhaus
2006-06-28 10:43         ` Alex R. Mosteo
2006-06-23 10:00 ` Compiler Bug or what I'm doing wrong? M E Leypold
replies disabled

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