From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c204c2633e999a33 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Rep Clause Vaues?? Date: 1997/01/24 Message-ID: #1/1 X-Deja-AN: 212101579 references: <5c3oh5$7oh@uuneo.neosoft.com> <01bc0862$77b689c0$018c71a5@dhoossr.iquest.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1997-01-24T00:00:00+00:00 List-Id: In article <01bc0862$77b689c0$018c71a5@dhoossr.iquest.com>, David C. Hoos, Sr. wrote: >-- E.g., for Mechs'Size use Integer'Size. ... >type Mechs_Bit_Pattern_Type is new Integer range 0 .. 2 ** Mechs'Size -1; >for Mechs_Bit_Pattern_Type'Size use Mechs'Size; If Mechs'Size = Integer'Size, then Integer'Last is probably 2**(Mechs'Size-1)-1, so the above will overflow. I suspect you meant: type Mechs_Bit_Pattern_Type is range 0 .. 2 ** Mechs'Size -1; which will work fine, IF the implementation supports integer types bigger than Integer. If you want an unsigned type that is the same size as the biggest supported signed integer, then you have to use modular types, which is unfortunate, because you lose overflow checking. (It's unfortunate if you *want* overflow checking, that is.) - Bob