14 May
2002
14 May
'02
11:31 a.m.
Hi Folks! I don't know whether it's a feature or a bug, I didn't find it on the list of known bugs so here is my report: Comparisions between Cardinal and Integer may fail, if the Integer value is negative. Version: 2.1 (20020510), based on gcc-2.95.2 19991024 (release) program testcase; var aCard: Cardinal; aInt: Integer; begin aCard := 1; aInt := -1; { "FAIL" } if (aCard > aInt) then WriteLn ('OK') else WriteLn ('FAIL'); { "FAIL" } if (aCard > -1) then WriteLn ('OK') else WriteLn ('FAIL'); { just for completness: "OK" } if (1 > -1) then WriteLn ('OK') else WriteLn ('FAIL') end. BTW: The gcc C fontend does the same. Eike