Incompatibility to Delphi / Kylix regarding operations on unsigned numbers
Original Reporter info from Mantis: theo @theo222
-
Reporter name:
Original Reporter info from Mantis: theo @theo222
- Reporter name:
Description:
procedure TForm1.Button1Click(Sender: TObject);
var a,b:Byte;
begin
{.$Q+}
a:=91;
b:=84;
Edit1.text:=(intToStr(a + b - 256)); // Delphi: -81, FPC: 4294967215
end;
Delphi/Kylix always returns "-81", no matter whether Overflow checking is on.
FPC returns "4294967215" resp. with {$Q+} "EIntOverflow".
Mantis conversion info:
- Mantis ID: 8321
- Fixed in version: 2.2.0
- Fixed in revision: 6586 (#9a37c041)