comp.lang.ada
 help / color / mirror / Atom feed
* GNAT 4.0 strange behaviour
@ 2005-09-12  0:02 James
  2005-09-12  0:36 ` jimmaureenrogers
  0 siblings, 1 reply; 5+ messages in thread
From: James @ 2005-09-12  0:02 UTC (permalink / raw)


This is a very small program compiled under linux debian with gnat 4 
based on gcc 4.0
The output of the program is
  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
which is of course not right...
If line labelled 1 is removed and replaced by line labelled 2, the 
output is correct.
The output is also correct if part 1 is replaced by part 2.
Any advice or place where I could send a bug report?

with Text_Io;
use Text_Io;
with Interfaces;
use Interfaces;


procedure Toto is
    type Intboard is new Unsigned_64;
    for Intboard'Size use 64;
    type Bit is new Integer range 0..1;
    for Bit'Size use 1;
    type Bitboard is array (0..63) of Bit;
    pragma Pack(Bitboard);
    for Bitboard'Size use 64;

    A_B : Bitboard;
    A_I : Intboard;
    for A_I'Address use A_B'Address;        --label1
--   for A_B'Address use A_I'Address;      --label2

begin
    --part 1
    for I in 0 .. 7 loop
       for J in 0 .. 7 loop
          A_B(I*8+J) := 1;
          Put(Bit'Image(A_B(I*8+J)));
       end loop;
    end loop;

    --part 2
--   for I in 0 .. 63 loop
--      A_B(I) := 1;
--      Put(Bit'Image(A_B(I)));
--   end loop;
end Toto;



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

end of thread, other threads:[~2005-09-12 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-12  0:02 GNAT 4.0 strange behaviour James
2005-09-12  0:36 ` jimmaureenrogers
2005-09-12  5:11   ` Simon Wright
2005-09-12 16:11   ` James
2005-09-12 16:16     ` James

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