On Fri, 4 Aug 2006, Russell Whitaker wrote:
On Sat, 5 Aug 2006, 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.
I got: 160 126835
using: Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6/specs Configured with: ../gcc-3.4.6/configure --enable-languages=c,c++,pascal --enable-shared --enable-threads-posix --enable-__cxa_atexit Thread model: posix gpc version 20060325, based on gcc-3.4.6
russ
adding "writeln( b[1]," ",b[i] ):" to the function (just before "test := ...") and I got: 160 1540222835 126835 126835
hope this helps russ