comp.lang.ada
 help / color / mirror / Atom feed
From: Anatoly Chernyshev <achernyshev@gmail.com>
Subject: Possible bug?
Date: Fri, 10 Jul 2015 02:46:23 -0700 (PDT)
Date: 2015-07-10T02:46:23-07:00	[thread overview]
Message-ID: <df6857dc-ffca-4468-898b-3bf001a789b6@googlegroups.com> (raw)

Hello everyone,

Here is a tiny program compiled in GNAT 2015, under Win 7:

procedure fail_arr is
n_d,n_f: constant integer:=10;
type tss is array (1..n_d,1..n_f) of float;
tser:tss:=(others=>(0.0,0.0));
begin
for i in tser'range(1) loop
for j in tser'range(2) loop
tser(i,j):=0.0;
end loop;
end loop;
end fail_arr;

From my understanding, in the declaration of tser, its first two columns must be populated with 0.0, and the rest is to be left uninitialized. But under no circumstances shall the array to have dimensions (n_d, 2). But that's exactly what happens in the program.

The compiler even gives me nice soft warning about this:

4:11 warning: too few elements for type "tss" defined at line 3
4:11 warning: "Constraint_Error" will be raised at run time

Even though it should abort the compilation with an error message. No?

             reply	other threads:[~2015-07-10  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  9:46 Anatoly Chernyshev [this message]
2015-07-10 10:06 ` Possible bug? J-P. Rosen
2015-07-10 22:33   ` Randy Brukardt
2015-07-11  0:29     ` Anatoly Chernyshev
replies disabled

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