Jonas Maebe wrote:
Hello,
While working on packed array support for FPC and verifying against GPC, I discovered a bug in GPC's packed array support. The following program prints 0 as second line instead of 1540222835
type ta = packed 0..$7fffffff; tb = packed array[0..40] of ta;
function test(i: longint): integer; var b: tb; begin b[1] := $5BCDEF73; test := b[i]; end;
begin writeln(sizeof(tb)); writeln(test(1)); end.
AFAICS it is an old known bug: packed arrays with elements bigger then 17 bits do not work on 32-bit machines (on 64-bit machines the biggest working size is 33-bits).