This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/15939] New: Support of 64 bits unsigned ranged integers


A 64 bits unsigned ranged integer type definition won't be accepted by GNAT (on 
x86).
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#;

end int64;

Compilation gives:
$ 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

Cheers,
JC

-- 
           Summary: Support of 64 bits unsigned ranged integers
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jc at apinc dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-pc-linux-gnu
  GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15939


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]