[fpc-devel] Bug 4004

Peter Vreman peter at freepascal.org
Tue Jun 7 23:02:05 CEST 2005


> Gerhard Scholz wrote:
>>
>> The check for overflow is obviously implemented different in 2.0.0 and
>> 2.1.1
>
> I'm not sure, at least
>
>> .L9:
>>      movw %dx,-12(%ebp)
>> .Ll3:
>
> suggests that the target is not an integer, but instead is a (possibly
> unsigned) word type. Please check again!
>
>> A solution would be to replace that line by:
>>     d := integer(Ord(a))-Ord(b)
>>
>> It seems that the compiler now sees a "ord(c)" to be a BYTE, and BYTE -
>> BYTE
>> shall give a BYTE, and -1 is not in the range allowed for a BYTE.
>
> Differences always should be interpreted as signed values, the error
> message IMO comes from the final assignment.

What with cardinal-cardinal and pointer-cardinal or pointer-byte? Those
can't be represented by a longint (the native singed type of pascal). In
2.0.0 the those were converted to int64 values, but users were complaining
about the warnings that were generated.







More information about the fpc-devel mailing list