Consider the following program:
MODULE test;
FROM libc IMPORT printf;
VAR
uval, i : CARDINAL;
ival, j : INTEGER;
BEGIN
printf("MAX(INTEGER) = %d\n", MAX(INTEGER));
printf("MIN(INTEGER) = %d\n", MIN(INTEGER));
ival := -2147483648;
printf("ival = %d\n", ival);
uval := ABS(ival);
printf("uval = %u\n", uval);
(* This fails, should probably work:
uval := ABS(MIN(INTEGER));
printf("uval = %u\n", uval);
*)
j := ABS(ival);
printf("j = %d\n", j);
(* ABS silently fails here due to the largest INTEGER is 2147483647 *)
END test.
As expected the ABS function fails due to the nature of two's complement
integers. Probably this should be cathed by the '-fsoft-check-all' flag as
this can create subtle errors on outside input data which is converted.
For me the '-fsoft-check-all' gives Segmentation fault.
Best regards
Runar Tenfjord