The following test program demonstrates a problem with packed arrays of boolean defined in a separate unit. What I see is D reported as 0 followed by a segmentation fault. The program works correctly if all the declarations are in the main program. I am using gpc20020402 based on gcc 2.95.2 on Red Hat 7.2 using kernel 2.4.9-31 with an i686 processor.
Program PackedAssignTest; Uses mltestu;
Var I,J:Integer; APackedBoolean:TPackedBoolean; Begin ARecord.C:=99; ARecord.D:=100; ARecord.PackedBoolean:=APackedBoolean; Writeln('D=',ARecord.D); End.
Unit mltestu; Interface
Const MaxA=5; MaxB=62;
Type TPackedBoolean=Packed Array[1..MaxA] of Packed Array[1..MaxB] of Boolean; TRecord = Record C:Integer; PackedBoolean:TPackedBoolean; D:Integer; End;
Var ARecord:TRecord;
Implementation
End.