From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10fdc2,8538e20ef38acc36,start X-Google-Attributes: gid10fdc2,public X-Google-Thread: 103376,8538e20ef38acc36,start X-Google-Attributes: gid103376,public From: Zheng Liu Subject: Problem with SGI ADA95 1.2 Date: 1999/06/02 Message-ID: <37554199.E8EDE1CE@space.gc.ca>#1/1 X-Deja-AN: 484880783 Content-Transfer-Encoding: 7bit Organization: Canadian Space Angency X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.sys.sgi.bugs,comp.lang.ada Date: 1999-06-02T00:00:00+00:00 List-Id: 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;