packed types and comparison operators bugs

Couperin f.couperin at online.fr
Mon Jul 31 16:50:47 CEST 2000


Le 30 Jul 2000, à 21:11, Russ Whitaker a écrit:

> Hi
> 
> In the first email the problem centers around "packed"
> and I don't know what's it doing.
> 
> In the 2nd email, 4 followed by 9 zeros as an integer is a negative
> number, -294967296
> 
> Without typecasting the comparisons are expecting integers
> So if you change X in the comparisons to longint(X) you get the right
> results
> 
> Perhaps this narrows the problem a little
> 
> Russ
> 

Hello

The thing I don't understand is the output :
X = 4000000000
X > 63 : False
but it doesn't really matter : the input was wrong, since it was out of range [0..125].

But about the packed type, I found another problem.
I can't compile this little program :
--------------------------------------------
Program Bug05;
Const
  XValMax : Byte = 125;
Type
  T_XVal = Packed 0..XValMax;
Var
  X : T_XVal = 64;
Begin
End.
--------------------------------------------
Here is the output :

Reading specs from c:/djgpp/lib/gcc-lib/djgpp/2.952/specs
gpc version 20000727, based on 2.95.2 19991024 (release)
[...]
Bug05.pas:8: constant out of range

--
"Couperin"




More information about the Gpc mailing list