A 64 bits unsigned ranged integer type definition won't be accepted by GNAT (on
This may not be a real bug, but a limitation. In this case requalify this report
as a feature request since I think it could be implemented (and in fact is
implemented but just for modular types, so without range/overflow checking).
The following code demonstrate what I'm saying:
package int64 is
type Unsigned_Modular_64 is mod 2**64;
type Unsigned_Ranged_63 is range 0 .. 16#7FFF_FFFF_FFFF_FFFF#;
type Signed_Ranged_64 is range -(2**63 - 1) .. 2**63 - 1;
-- Following won't be accepted
type Unsigned_Ranged_64 is range 0 .. 16#8000_0000_0000_0000#;
$ gnatmake int64.ads
gcc-3.4 -c int64.ads
int64.ads:8:31: integer type definition bounds out of range
gnatmake: "int64.ads" compilation error
As you said, if you want unsigned 64 bits, you can use modular types.
For range types, extra arithmetic is needed for overflow checks, etc...
and since GCC only support up to 64bits integer, this won't get