Gale Paeper wrote:
While helping someone port a MacPascal Object Pascal program to GPC, an internal compiler error was encountered when an object method heading signature type declaration didn't match the method implementation's heading signature. A distilled down test program that reproduces the internal compiler error:
{$mac-objects}
program MethodParameterMismatchBug;
type UInt8 = Byte; Str255 = record sLength: UInt8; sChars: packed array[1..255] of char; end;
xButton = object procedure SetUp (name: Str255); end;
procedure xButton.Setup(name: string); {WRONG} begin end;
begin end.
When you compile it with "gpc -c MethodParameterMismatchBug.pas", you get:
MethodParameterMismatchBug.pas:17: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions.
The GPC used for compiling is the Mac OS X GPC that Adriaan is distributing from his web site. The specs are:
Reading specs from /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin8/3.4.5/specs Configured with: ../gcc-3.4.5/configure --enable-languages=pascal,c --enable-threads=posix --target=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --build=powerpc-apple-darwin8 --prefix=/Developer/Pascal/gpc345u2 Thread model: posix gpc version 20051116, based on gcc-3.4.5
Parameter checking and passing changed significantly in gpc-20060215. I do not have 20051116 handy to check, but both 20060215 and 20060325 give just error message: gale.p:16: error: routine definition does not match previous declaration gale.p:13: error: previous declaration
gpc-20050331 first complains about {$mac-object} and then crashes. So, I would suggest just to try newer version.