> For Ada we would write
> type Jint is range -2**31 .. 2**31 - 1;
> for Jint'Size use 32;
Or how about:
package Interfaces.Java is
...
type int is .....
> And this will work on any platform where the Ada compiler
> can handle 32 bit numbers.
Actually, I have seen at least one Ada _83_ compiler that could handle
32-bit numbers, but could not handle the above declaration. Due to
precedence rules, they felt they had to compute 2**31 first, and then
print
type ..... is range -2**31 .. 2**31 - 1;
^ ^
(cryptic message that has something to do with available machine types)
The ugly workaround was
Big_Number : constant := 2**30;
type ..... is range (- Big_Number - Big_Number) ..
((Big_Number - 1) + Big_Number);