Posted: 27 Jan 2015 13:46
The Language Reference says about uncheckedConvert: >>It makes only compile time checking of bit-size equality of the converted domains.<< But why below predicate test outputs in 64 bit mode (in 7501) "converted variable of size 4 unchecked to variable of size 8"? Its further output "IntNative = -2147483648" shows, that it did not convert a memory address (of an unsigned) unchecked to an unsignedNative, but that in fact the value of the variable Var has been converted.
Regards
Martin
Code: Select all
class predicates
test : ().
clauses
test() :-
hasDomain(integer, LowInt),
LowInt = lowerBound(integer),
stdIo::write("lowerBound(integer) = ", LowInt, "\n"),
test_1(LowInt).
class predicates
test_1 : (Type Var).
clauses
test_1(Var) :-
IntNative = uncheckedConvert(integerNative, Var),
stdIo::write("converted variable of size ", sizeOf(Var), " unchecked to variable of size ", sizeOf(IntNative), "\n"),
stdIo::write("IntNative = ", IntNative).
Martin