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,d7ae8269a4ecf7c4 X-Google-Attributes: gid103376,public From: dmarshal@netcom.com (Dave Marshall) Subject: Re: Prevalence of Compilers for Which Integer'Size < 32? Date: 1996/07/28 Message-ID: #1/1 X-Deja-AN: 170546469 sender: dmarshal@netcom16.netcom.com references: <4tdp24$5h1@news.pacifier.com> organization: NETCOM On-line Communication Services (408 261-4700 guest) newsgroups: comp.lang.ada Date: 1996-07-28T00:00:00+00:00 List-Id: steved@pacifier.com@199.2.117.163 (Steve Doiel) writes: >Dave Marshall writes: >>So here I am, looking at some old code while I wonder what I was >>thinking when I wrote it. Suddenly, I see something that will raise >>Constraint_Error if a compiler's Integer'Size is less than 32. >> >Sorry for not answering your question but... >In my experience I have found that if portablilty is a concern, then all >predefined types should be avoided. It's impossible to disagree with this. Indeed, I believe that explicitly declaring one's types rather than using predefined types adds to code's maintainability to an even greater degree. However, the thrust of my question was more towards the available values for integer types rather than any specific typing schemes. I apologize for not having been so unspecific. My specific question revolves around something such as this example that you'll find in a lot of time-handling packages. type Seconds_In_A_Day is range 0 .. 86_400; This is going to work fine for compilers for which Integer'Size is 32, but it will fail for compilers for which Integer'Size = 16. Of course, this is because the above statement is equivalent to type some_anonymous_integer_type is new Integer; subtype Seconds_In_A_Day is some_anonymous_integer_type range 0 ..86400; If Integer'Last is 65535, ka-bloowie. Rather than make another entry in the predefined-types versus user-defined-types battles, I thought I'd just get right to the matter and try to get the information I was after. -- Dave Marshall dmarshal@netcom.com