comp.lang.ada
 help / color / mirror / Atom feed
From: Natasha Kerensikova <lithiumcat@gmail.com>
Subject: Re: My first compiler bug: work around or redesign?
Date: Fri, 23 Mar 2012 21:34:01 +0000 (UTC)
Date: 2012-03-23T21:34:01+00:00	[thread overview]
Message-ID: <slrnjmpr23.1lme.lithiumcat@sigil.instinctive.eu> (raw)
In-Reply-To: 10kx1zr05qt9s$.ab8q1peu0ukt.dlg@40tude.net

On 2012-03-23, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
> On Fri, 23 Mar 2012 16:29:06 +0000 (UTC), Natasha Kerensikova wrote:
>
>> I happen to have encountered my very first compiler bug, or at least
>> something that claims to be in the following message
>
> First, make sure your code is legal. In some cases GNAT crashes when
> detects an error in the program. One method to find the problem is to
> comment offending source code lines until it compiles and then twist it
> this or that way.

I tried that method, until there was so much to remove that nothing made
sense anymore. As far as I can tell, any "local" generic instantiation
in that package triggers the compiler error.

Surprisingly (at least for me), the error is triggered on the first
instantiation, even though the message reports the declaration location
first and then only the instantiation location.

>> I guess the problem somehow involves generics:
>
> Yep,  there are always problems with generics in GNAT, usually related to
> visibility. Use renaming/subtyping of the formal parameters. This might
> help to work around bugs.

I don't really understand how visibility comes into play here, since
declaration, body and instantiation all reside in the same package body.
However I admit that compiler writing is arcane enough to lead to
unintuitive situation, but such a flat single isolated namespace should
be the easiest to deal with.


Thanks for your help,
Natasha



  parent reply	other threads:[~2012-03-23 21:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 16:29 My first compiler bug: work around or redesign? Natasha Kerensikova
2012-03-23 17:51 ` Ludovic Brenta
2012-03-23 21:20   ` Natasha Kerensikova
2012-03-23 17:56 ` Jeffrey Carter
2012-03-23 18:22 ` Jeffrey Carter
2012-03-23 21:23   ` Natasha Kerensikova
2012-03-23 22:54     ` Jeffrey Carter
2012-03-23 18:29 ` Simon Wright
2012-03-23 18:37 ` Dmitry A. Kazakov
2012-03-23 18:48   ` Robert A Duff
2012-03-23 21:40     ` Natasha Kerensikova
2012-03-24  0:04       ` Georg Bauhaus
2012-03-24  9:50         ` Natasha Kerensikova
2012-03-23 21:34   ` Natasha Kerensikova [this message]
2012-03-23 19:04 ` Jeffrey Carter
2012-03-26 18:15 ` Natasha Kerensikova
2012-03-26 18:43   ` Simon Wright
2012-03-26 18:55   ` Ludovic Brenta
2012-03-28 15:30     ` Natasha Kerensikova
2012-03-29  8:25       ` Ludovic Brenta
2012-03-30 23:42         ` onox
2012-04-02 20:51           ` Ludovic Brenta
2012-04-03  2:50             ` onox
2012-03-26 21:47   ` Georg Bauhaus
2012-03-27  5:34     ` Per Sandberg
2012-03-27  7:30     ` Dmitry A. Kazakov
replies disabled

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