TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
"Robert I. Eachus" <[log in to unmask]>
Reply To:
Robert I. Eachus
Date:
Thu, 12 Nov 1998 11:47:44 -0500
Content-Type:
text/plain
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
>declarations.

   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...

ATOM RSS1 RSS2