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-Thread: 103376,7b65fc33a05f24b6 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!usenet-fr.net!nospam.fr.eu.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!cleanfeed1-a.proxad.net!nnrp14-1.free.fr!not-for-mail From: Samuel Tardieu Newsgroups: comp.lang.ada Subject: Re: A curiosity... References: <0f009ce8-0f50-4b85-9368-0d0c68f42da1@w34g2000yqm.googlegroups.com> <396044ea-4c37-4923-b989-eb4af2202bd3@o2g2000yqd.googlegroups.com> Date: Fri, 05 Dec 2008 09:02:21 +0100 Message-ID: <87r64naw36.fsf@willow.rfc1149.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:5n1iFSc8VxQ+d+0RHOsm1710vHc= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Leafnode-NNTP-Posting-Host: 2001:6f8:37a:2::2 Organization: Guest of ProXad - France NNTP-Posting-Date: 05 Dec 2008 09:05:02 MET NNTP-Posting-Host: 91.121.19.179 X-Trace: 1228464302 news-1.free.fr 30899 91.121.19.179:39272 X-Complaints-To: abuse@proxad.net Xref: g2news1.google.com comp.lang.ada:2885 Date: 2008-12-05T09:05:02+01:00 List-Id: >>>>> "Ludovic" == Ludovic Brenta writes: Ludovic> And I think this rule is responsible for the "limitation" Ludovic> that all current processor architectures use addresses which Ludovic> are the same size as integers. Before the advent of C, Ludovic> address size and word size were not necessarily the same; now Ludovic> they always are, and that's *only* for compatibility with C. Certainly not. For example, on a x86_64 Linux machine with GCC, you can try the following snippet (untested): #include int main() { printf("integer size is %d, pointer size is %d\n", sizeof(int), sizeof(void*)); return 0; } You should get respectively 4 and 8. Ludovic> Nowadays, computers are moving towards non-uniform memory Ludovic> architectures (e.g. main memory, video memory, network Ludovic> interface cache memory, physics processor memory, etc.) which Ludovic> would map extremely well to Ada's storage pools and very Ludovic> poorly with C's pointer arithmetic. Nah, this is a FUD. If you want to use an integer type in C which is compatible with addresses, you should use "size_t" explicitely, not any other integer type (though I know of no architecture where "unsigned long" is not the same as "size_t" even though this is allowed). Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/