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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b5b40006550b942 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-05 01:24:37 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!adsl-213-200-246-247.cybernet.CH!not-for-mail From: Vinzent 'Gadget' Hoefler Newsgroups: comp.lang.ada Subject: Re: data types & efficiency Date: Fri, 05 Mar 2004 10:23:49 +0100 Organization: JeLlyFish software Message-ID: <5ohg40ls073v1b5d8idail4t365f57l8os@jellix.jlfencey.com> References: NNTP-Posting-Host: adsl-213-200-246-247.cybernet.ch (213.200.246.247) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 1078478677 62265917 I 213.200.246.247 ([175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:6070 Date: 2004-03-05T10:23:49+01:00 List-Id: Davide wrote: >speaking in general, if I have a *XX-bit* architecture for which I'm >developing software in Ada, and I need to declare some *scalar* (not = records >nor arrays etc.) variable eg. integer: what should be better to do: > >1) always declare that variable as the *smallest* data type that will = hold >the highest value of its possible range (example: if it can assume = values >from 0 to 150 then declare it as an 8-bit integer); > >2) tend to declare the variable as the machine "native" data type, i.e. >XX-bit represented. 3) Declare the type by specifying its range and let the compiler figure out what could be more efficient on the hardware. Vinzent.