[fpc-devel] CompareValue

C Western mftq75 at dsl.pipex.com
Sat Mar 3 15:39:30 CET 2007


Пётр Косаревский wrote:
>> In the math unit are the CompareValue functions only for signed integers. Why not 
>> for DWORD and QWORD?
> 
> I guess, that it's Delphi mimicing implementation (because it is Delphi-like).
> 
> And it can be tricky to distinguish signed and unsigned expression values.
> 
> Like, 
> 
> a: qword;
> a-1 --- ??? (anyone may know for sure that a-1>0 and want to subtract one)
> 
> I guess it's something like that.

If you check <http://www.freepascal.org/mantis/view.php?id=8448> you can 
see this bug in action - the fpcadds and math unit provide signed and 
unsigned versions of CompareValue, but the correct one is not always chosen.

Colin




More information about the fpc-devel mailing list