Hi, all
Frank Heckenbach wrote:
Toby Ewing wrote:
program testMT; uses GPC, MTrand; {MTrand is the name of the unit I'm working on} const big = 10000000; TimeFormat = ' %Q'; var t1, t2, i, j : medCard; CurrentTime : TimeStamp;
begin SeedRand(1234567890); GetTimeStamp (CurrentTime); WriteStr(FormatTime(CurrentTime, TimeFormat), t1); { line 17 } for i := 1 to big do j := randInt; GetTimeStamp (CurrentTime); WriteStr(FormatTime(CurrentTime, TimeFormat), t2); Writeln('Elapsed time: ', (t2 - t1):1); end.
The compiler hangs with the following error: testmt.pas(17): Error: reference expected, value given testmt.pas(17): Error: reference expected, value given testmt.pas(17): Error: tree check: expected class 't', have 'x' (error_mark) in require_complete_type, at p/typecheck.c:63 Please submit a full bug report
I can't reproduce the problem, but I don't know if it's because I might have fixed already (with other changes in the meantime) or because I don't have your unit. Does the following program without the unit also exhibit the problem? Otherwise, could you please send a program to reproduce it?
program testMT; uses GPC; const big = 10000000; TimeFormat = ' %Q'; var t1, t2, i, j : medCard; CurrentTime : TimeStamp; begin GetTimeStamp (CurrentTime); WriteStr(FormatTime(CurrentTime, TimeFormat), t1); { line 17 } { WRONG } for i := 1 to big do j := randInt; GetTimeStamp (CurrentTime); WriteStr(FormatTime(CurrentTime, TimeFormat), t2); Writeln('Elapsed time: ', (t2 - t1):1); end.
I compiled the above code, and got the same error: frank.pas: In main program: frank.pas:12: reference expected, value given frank.pas:12: reference expected, value given frank.pas:12: tree check: expected class 't', have 'x' (error_mark) in require_complete_type, at p/typecheck.c:63 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions.
If more recent versions of gpc have fixed this, please tell me! I'm currently running version 20030507, based on gcc-3.2.2
Toby