comp.lang.ada
 help / color / mirror / Atom feed
From: sun-barr!cs.utexas.edu!usc!rpi!psinntp!psinntp!vitro.com!v7.vitro.com!v7. vitro.com!news@ames.arc.nasa.gov  (M. J. Mangieri)
Subject: Derived types and portability
Date: 25 Sep 92 16:20:00 GMT	[thread overview]
Message-ID: <1992Sep25.112001.261@v7.vitro.com> (raw)

I have always achieved portability by using user-defined types such as:

     type MY_INTEGER is range 0 .. 2**32-1;

However, I recently came across a document that suggested using derived types
in combination with length representation clauses to achieve portability:

     type MY_INTEGER is new INTEGER;
     for MY_INTEGER'SIZE use 32;

Are these two methods equivalent? I understand the second case to simply
reserve more storage. For example, if the platform is a PC, where INTEGER is 16
bits, I would think the run-time would still enforce a range of values that are
limited to 16 bits, but give you a word size of 32 bits.
Is this correct, or am I missing something?
         __________________________________________________________________
        / Michael J. Mangieri                 Internet: mmangieri@vitro.com
__     /  Vitro Corporation                      Voice:      (301) 231-3016
  \   /   MX-SP 4-2311                             FAX:      (301) 231-1233
   \ /    14000 Georgia Ave.              
    *     Silver Spring, MD 20906-2972    

         "Everything should be made as simple as possible, but not simpler."
                                                       - A. Einstein

                 reply	other threads:[~1992-09-25 16:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox