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.
Martin Liddle wrote:
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.
The following patch should fix it. Thanks for the report. (martin3.pas)
Frank
In article 200204251400.QAA08738@goedel.fjf.gnu.de, Frank Heckenbach frank@g-n-u.de writes
Martin Liddle wrote:
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.
The following patch should fix it. Thanks for the report. (martin3.pas)
Thanks for fixing this. I'll update to the latest RC versions and report back later this week.