comp.lang.ada
 help / color / mirror / Atom feed
* GNAT Problem with variable length Arrays
@ 2000-03-22  0:00 Torsten Leistikow
  2000-03-22  0:00 ` Philippe Waroquiers
  2000-03-22  0:00 ` Florian Weimer
  0 siblings, 2 replies; 5+ messages in thread
From: Torsten Leistikow @ 2000-03-22  0:00 UTC (permalink / raw)


Hi,

as I am trying to get used to Ada, I stumble into many errors. So I am also
getting used to the GNAT error messages. But with the example listed below,
GNAT 3.12.a2 under NT just didn't stop compiling in a reasonable ammount of
time.

I know now, that the type declarations are in a wrong order, but it took me
quite a long time to figure it out, caused by the missing response from the
compiler.

Is this an exspected behaviour of the compiler, or some kind of a bug?


package type_test_problem is

  type a_type is range 0..2;

  type internal_array_type is array (a_type range <>, b_type range <>) of
integer;

  type c_type (first_bound  : a_type :=0;
               second_bound : b_type :=0) is
       record

         internal_array : internal_array_type (1..first_bound,
                                               1..second_bound);
       end record;

  type b_type is range 0..1;

end type_test_problem;






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

* Re: GNAT Problem with variable length Arrays
  2000-03-22  0:00 ` Florian Weimer
@ 2000-03-22  0:00   ` Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2000-03-22  0:00 UTC (permalink / raw)


In article <87ya7bgzbu.fsf@deneb.cygnus.argh.org>,
  Florian Weimer <fw-usenet@deneb.cygnus.argh.org> wrote:
> "Torsten Leistikow" <leistikow@stn-atlas.de> writes:
>
> > Is this an exspected behaviour of the compiler, or some kind
of a bug?
>
> It's certainly a bug.  Sometimes, when using a type before it
is
> actually declared, GNAT runs into an infinite loop.  Another
(quite
> silly) example is:
>
> package type_test_problem is
>
>    type Some_Type_Class is private;
>
> private
>
>    type Some_Type_Class is new Some_Type_Class'Class;
>
> end type_test_problem;

Well you should certainly report *any* bug to report@gnat.com,
although this one must be due to using an old version of GNAT.

test_problem.ads:7:09: full view of type must be definite
subtype
test_problem.ads:7:47: type cannot be used in its own definition



Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: GNAT Problem with variable length Arrays
  2000-03-22  0:00 ` Philippe Waroquiers
@ 2000-03-22  0:00   ` Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2000-03-22  0:00 UTC (permalink / raw)


In article <rcln3bmirh.fsf@gull.tact.cfmu.eurocontrol.be>,
  Philippe Waroquiers <philippe@gull.tact.cfmu.eurocontrol.be>
wrote:
>
> I encountered once a similar problem (compilation did not
stop).
>
> After some time, I thought to use the switch -gnate -gnatf
> documented in the user's guide section '20.9 Abnormal
Termination'.
> The errors are then output immediately (even if the
compilation
> still does not stop).
>
> A suggestion was given to ACT to slightly modify this section
and
> section title in order to suggest that these switches are also
useful
> in case gnat does not terminate :).


Note that it is NOT a good idea to routinely use -gnate, and
in fact we may move this to a debugging switch. Why? because
it disconnects a lot of useful error handling circuitry (GNAT
needs all the error messages at hand to massage them before
outputting them, if you force output as you go along, you
remove this possibility), but it is indeed useful in the
occasional cases where the compiler goes into a loop or
gets a system exception (it is not useful in the case where
a GNAT BUG DETECTED box is printed).


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: GNAT Problem with variable length Arrays
  2000-03-22  0:00 GNAT Problem with variable length Arrays Torsten Leistikow
  2000-03-22  0:00 ` Philippe Waroquiers
@ 2000-03-22  0:00 ` Florian Weimer
  2000-03-22  0:00   ` Robert Dewar
  1 sibling, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2000-03-22  0:00 UTC (permalink / raw)


"Torsten Leistikow" <leistikow@stn-atlas.de> writes:

> Is this an exspected behaviour of the compiler, or some kind of a bug?

It's certainly a bug.  Sometimes, when using a type before it is
actually declared, GNAT runs into an infinite loop.  Another (quite
silly) example is:

package type_test_problem is

   type Some_Type_Class is private;

private

   type Some_Type_Class is new Some_Type_Class'Class;

end type_test_problem;




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

* Re: GNAT Problem with variable length Arrays
  2000-03-22  0:00 GNAT Problem with variable length Arrays Torsten Leistikow
@ 2000-03-22  0:00 ` Philippe Waroquiers
  2000-03-22  0:00   ` Robert Dewar
  2000-03-22  0:00 ` Florian Weimer
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Waroquiers @ 2000-03-22  0:00 UTC (permalink / raw)



I encountered once a similar problem (compilation did not stop).

After some time, I thought to use the switch -gnate -gnatf
documented in the user's guide section '20.9 Abnormal Termination'.
The errors are then output immediately (even if the compilation
still does not stop).

A suggestion was given to ACT to slightly modify this section and
section title in order to suggest that these switches are also useful 
in case gnat does not terminate :).


-- 
Philippe WAROQUIERS             Eurocontrol - Central Flow Management Unit
philippe@cfmu.eurocontrol.be    Rue de la fusee, 96
Tel: +32 2 729 97 35            1130 Brussels
Fax: +32 2 729 90 22            Belgium




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

end of thread, other threads:[~2000-03-22  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-22  0:00 GNAT Problem with variable length Arrays Torsten Leistikow
2000-03-22  0:00 ` Philippe Waroquiers
2000-03-22  0:00   ` Robert Dewar
2000-03-22  0:00 ` Florian Weimer
2000-03-22  0:00   ` Robert Dewar

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