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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e6cdf6ff50e684 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-09 22:30:18 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed.yosemite.net!news-out.cwix.com!newsfeed.cwix.com!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Representation clause for enumeratives Date: Sat, 10 Feb 2001 06:19:17 GMT Organization: Deja.com Message-ID: <962mh2$f9v$1@nnrp1.deja.com> References: <95tqbh$ag7$1@nnrp1.deja.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Sat Feb 10 06:19:17 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x60.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:5091 Date: 2001-02-10T06:19:17+00:00 List-Id: In article , "Ken Garlington" wrote: > I don't know if either behavior is considered "wrong" by the standard. I'm > not comfortable with the GNAT behavior, since it treats 16#8000_0000# as a > legal 32-bit integer value, although it is not in the range Standard.Integer > on the same machine. Who says that the range of enumeration values is restricted to Standard.Integer, in fact no one says it, and the RH in the RM encourages you to go up to maxint which for GNAT is 2**63-1. Why you should be uncomfortable because GNAT does NOT implement a limitation which (a) would not be helpful (b) would violate implementation advice is puzzling indeed! > This just encourages the confusion between hex numbers > and bit-patterns. I do see the utility of doing it this way, > however. I don't understand the confusion. GNAT chooses a large enough signed or unsigned integer type to cover the range of values provided. Note that 16#8000_0000# is the number 2**32, it is a POSITIVE number, nothing at all to do with the largest negative number. I think the confusion is coming from the use of base 16, and suddenly that is translating into bit patterns in your mind??? Any time you write 16#8000_0000# in your program, you could equally well write 2147483648. The meaning is 100% identical. If the first looks like a bit pattern to you, and the second looks like an integer, then that's your confusion, not Ada's :-) Sent via Deja.com http://www.deja.com/