Bus error with new gpc snapshot

Peter Schorn peter.schorn at acm.org
Wed Sep 19 21:32:34 CEST 2007


I am using the new gpc snapshot on OSX 10.4.10 (PPC) and compile the 
following program:

program prog;

procedure dcp;
   type
     pv = record
       x, y: Extended;
       v: array[1..2] of Boolean;
     end;
   var
     sp: pv;
     z: Boolean;

   procedure d(p: pv);
     begin
       writeln('access z before');
       if z then
         writeln('z is true');
     end;

   begin { dcp }
     z := True;
     d(sp);
   end;

begin
dcp;
end.

petersch% /Developer/Pascal/gpc412/bin/gpc -o prog prog.pas
petersch% prog
access z before
Bus error

Note that the program works ok with gpc 20060325, based on gcc-3.4.5. 
The program also works with the latest compiler when making variable z 
global.

Any ideas?

Peter





More information about the Gpc mailing list