comp.lang.ada
 help / color / mirror / Atom feed
From: "Anders Wirzenius" <anders.wirzenius@pp.qnet.fi>
Subject: Re: Why does this happen?
Date: Wed, 16 Oct 2002 06:02:56 GMT
Date: 2002-10-16T06:02:56+00:00	[thread overview]
Message-ID: <ki7r9.32$cX1.2997@read2.inet.fi> (raw)
In-Reply-To: D64r9.59604$rz6.10428@sccrnsc02

<tmoran@acm.org> wrote in message news:D64r9.59604$rz6.10428@sccrnsc02...
> >   Type Mtr_Type is array (Positive range <>,
> >                           Positive range <>) of integer;
> >
> >   type T_typ (Ns : Positive) is record
> >      M : Mtr_Type (1..2, 1 .. ns);  -- does not compile
> >   end record;
>
> Gnat 3.14 on my Windows system compiles those lines without complaint.

... but not on my Gnat 3.14, Windows NT.
I get the same error message as OP.

instead
       M : Mtr_Type (-1..ns, -1..ns);
compiles without errors.

Could it be a question of elaboration, because a compilation, having
       M : Mtr_Type (-1..ns, -1..ns);
in test.ads,
of a test_test.adb

with test;
with Ada.Text_IO;
procedure test_test is
   A: test.T_typ(2);
begin
   null;
end;

gives the warning

test.ads:7:22: warning: static value out of range of type
"Standard.positive"
test.ads:7:22: warning: "constraint_error" will be raised at run time

Anders Wirzenius







  reply	other threads:[~2002-10-16  6:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15 22:12 Why does this happen? svesse
2002-10-16  0:46 ` Dennis Lee Bieber
2002-10-16  2:25 ` tmoran
2002-10-16  6:02   ` Anders Wirzenius [this message]
2002-10-16  7:32     ` tmoran
2002-10-16 13:44       ` Frank J. Lhota
2002-10-16  5:36 ` Simon Wright
2002-10-16 15:53   ` Jerry van Dijk
2002-10-17  9:50     ` Colin Paul Gloster
2002-10-17 12:08       ` Jerry van Dijk
2002-10-16 19:56 ` Gautier
replies disabled

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