comp.lang.ada
 help / color / mirror / Atom feed
* Re: Problem with SGI ADA95 1.2
  1999-06-02  0:00 Problem with SGI ADA95 1.2 Zheng Liu
@ 1999-06-02  0:00 ` Robert Dewar
  1999-06-02  0:00 ` David C. Hoos, Sr.
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1999-06-02  0:00 UTC (permalink / raw)


In article <37554199.E8EDE1CE@space.gc.ca>,
  Zheng Liu <zheng.liu@space.gc.ca> wrote:
> I am having a problem to assign values to a bit-packed Boolean
array
> using the following program. The compiler I used is SGI ADA95
Release
> 1.2. In this
> program, I declaraed a record that contains a packed Boolean
array with
> all its
> elements inilialized to False. When I was trying to set the
first
> element to True,
> the program sets the 2nd, the 4th and the 6th elements to True
instead.
> The first
> element remains False.

You are using a very out of date version of the compiler. Please
check with your SGI representative to obtain the latest version
of the compiler.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




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

* Re: Problem with SGI ADA95 1.2
  1999-06-02  0:00 Problem with SGI ADA95 1.2 Zheng Liu
  1999-06-02  0:00 ` Robert Dewar
@ 1999-06-02  0:00 ` David C. Hoos, Sr.
  1 sibling, 0 replies; 3+ messages in thread
From: David C. Hoos, Sr. @ 1999-06-02  0:00 UTC (permalink / raw)



Zheng Liu wrote in message <37554199.E8EDE1CE@space.gc.ca>...
>I am having a problem to assign values to a bit-packed Boolean array
>using the following program. The compiler I used is SGI ADA95 Release
>1.2. In this
>program, I declaraed a record that contains a packed Boolean array with
>all its
>elements inilialized to False. When I was trying to set the first
>element to True,
>the program sets the 2nd, the 4th and the 6th elements to True instead.
>The first
>element remains False.
>
>Does anybody have an idea why this is happenning?
>
The program runs fine on Linux/gnat-3.11p

SGI 1.2 is pretty old -- gnat-3.07 if I remember correctly
1.3 has been out for about a year now.  Why don't you step up to it?








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

* Problem with SGI ADA95 1.2
@ 1999-06-02  0:00 Zheng Liu
  1999-06-02  0:00 ` Robert Dewar
  1999-06-02  0:00 ` David C. Hoos, Sr.
  0 siblings, 2 replies; 3+ messages in thread
From: Zheng Liu @ 1999-06-02  0:00 UTC (permalink / raw)


I am having a problem to assign values to a bit-packed Boolean array
using the following program. The compiler I used is SGI ADA95 Release
1.2. In this
program, I declaraed a record that contains a packed Boolean array with
all its
elements inilialized to False. When I was trying to set the first
element to True,
the program sets the 2nd, the 4th and the 6th elements to True instead.
The first
element remains False.

Does anybody have an idea why this is happenning?


-- test bit-packed boolean variable assignment

with Text_Io;

procedure Bit_Test1 is

   package Bool_Io is new Text_IO.Enumeration_Io(Boolean);
   use Bool_Io;
   package Int1_Io is new Text_Io.Integer_Io(Integer);

    type Bool_Array_type is array ( 1 .. 9 ) of Boolean;
    pragma Pack ( Bool_Array_Type);
    Bool_Array : Bool_Array_Type := (others => False);

    type Test_Record_Type is
      record
         Bool_Array : Bool_Array_Type := ( others => False);
         Spare : Integer range 0 .. 65535 := 0;
      end Record;
    for Test_Record_Type use
       record
        Bool_Array at 0 range 0 .. 8;
        Spare at 2 range 0 ..15;
       end record;

    Test_Record : Test_Record_Type;

    Test_Word : Integer range 0 .. 155;
    for Test_Word'Size use 8;
    for Test_Word use at Test_Record'Address;

  begin

    Test_Record.Bool_Array(1) := true;
    Text_Io.Put_Line("test_record bool 1 ");
    Put(Test_Record.Bool_Array(1));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 2 ");
    Put(Test_Record.Bool_Array(2));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 3 ");
    Put(Test_Record.Bool_Array(3));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 4 ");
    Put(Test_Record.Bool_Array(4));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 5 ");
    Put(Test_Record.Bool_Array(5));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 6 ");
    Put(Test_Record.Bool_Array(6));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 7 ");
    Put(Test_Record.Bool_Array(7));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 8 ");
    Put(Test_Record.Bool_Array(8));
    Text_Io.New_Line;
    Text_Io.Put_Line("test_record bool 9 ");
    Put(Test_Record.Bool_Array(9));
    Text_Io.New_Line;
    Text_Io.Put_Line("spare");
    Int1_Io.Put(Test_Record.Spare);
    Text_Io.New_Line;
    Text_Io.Put_Line("Test_Word");
    Int1_Io.Put(Test_Word);

end Bit_Test1;





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

end of thread, other threads:[~1999-06-02  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-02  0:00 Problem with SGI ADA95 1.2 Zheng Liu
1999-06-02  0:00 ` Robert Dewar
1999-06-02  0:00 ` David C. Hoos, Sr.

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