bug (?) in Time Format

Toby Ewing ewing at iastate.edu
Fri Feb 27 20:52:21 CET 2004

Hi, all

There have been some recent improvements to the Mersenne Twister (the random 
number generator that is used in the GPC unit), and I've been translating them 
into Pascal for eventual submission to the programming team.  As part of this, I 
wanted to check the execution time, so I wrote a timer (I thought!) into a test 

program testMT;
uses GPC, MTrand;  {MTrand is the name of the unit I'm working on}
   big = 10000000;
   TimeFormat = ' %Q';
   t1, t2, i, j  : medCard;
   CurrentTime   : TimeStamp;

   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);

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'm guessing that it's not about my unit, but rather what I'm trying to do with 
capturing a string into an int... anyway, here is a bug report.


More information about the Gpc mailing list