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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b5b40006550b942,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-05 00:40:29 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!green.octanews.net!news-out.octanews.net!news.glorb.com!newsgate.cistron.nl!news.cambrium.nl!news.cambrium.nl!humbolt.nl.linux.org!news.nl.linux.org!surfnet.nl!teleglobe.net!151.99.250.105.MISMATCH!news.finmeccanica.it!not-for-mail From: "Davide" Newsgroups: comp.lang.ada Subject: data types & efficiency Date: Fri, 5 Mar 2004 09:02:56 +0100 Organization: Finmeccanica Message-ID: NNTP-Posting-Host: 192.168.54.114 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:6069 Date: 2004-03-05T09:02:56+01:00 List-Id: hello everybody, 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. I think considerations should be made about efficiency and memory occupation *but* (maybe) taking into account memory alignment (that could vanify considerations made at point 1...maybe). Waiting for your opinions, thanks in advance.