Hi,
Consider the following program (compiled using revision 26807 on OSX):
=======
Program QWordToExtended;
Begin
WriteLn(Sizeof(Extended));
WriteLn(Sizeof(QWord));
WriteLn(Sizeof(Longword));
WriteLn(Extended(QWord($FFFFFFFFFFFFFFFF))); //1
WriteLn(Extended($FFFFFFFFFFFFFFFF)); //2
WriteLn(Extended(Longword($FFFFFFFF))); //3
WriteLn(Extended($FFFFFFFF)); //4
End.
=======
Here I would expect four rather large values on standard output. The thing is
that the second test gives me -1. I suspect this is due to the compiler
interpreting the constant as an Int64; this is confirmed by the first test.
Since I was curious as to the intended-ness of this behaviour I wrote the
second set of tests which show me that this is not true for longwords: both 3 &
4 give the same result. This lead me to the conclusion that this is a bug.
Shall I file it?
Some important note, I think: the first sizeof's of the example return 10, 8, 4
on this machine.
--
Ewald
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel