TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version: 1.0
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
X-To: "W. Wesley Groleau x4923" <[log in to unmask]>
Date: Thu, 12 Nov 1998 11:47:44 -0500
Reply-To: "Robert I. Eachus" <[log in to unmask]>
From: "Robert I. Eachus" <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset="us-ascii"
Parts/Attachments: text/plain (26 lines)
At 09:58 AM 11/11/98 -0500, W. Wesley Groleau x4923 wrote:
>If your algorithm depends on a type or object having a certain range or
>size, you declare the type or object accordingly, and tell your suppliers
>you can only accept compilers and hardware that will accept your

   It is actually better, if you need a 32-bit Integer type, to declare:

subtype Integer32 is Integer range -2_147_483_648..2_147_483_647;
for Integer32'Size use 32;

   or some such.  The declaration will be rejected in Ada 95 if Integer does
not have the required range, this is a change from Ada 83.  (Of course, it is
possible that you will run into a compiler that supports 32-bit Integer
types, but where Integer is larger.  You can detect that--if it is
important--by adding:

X: Integer;
for X'Size use 32;

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...