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=unavailable autolearn_force=no version=3.4.4 X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!87.79.20.101.MISMATCH!newsreader4.netcologne.de!news.netcologne.de!novso.com!nerim.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Hash Type Size Date: Mon, 19 Aug 2013 17:21:52 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1679ec49-424b-43bd-8f35-a5f69e658112@googlegroups.com> <8e573dcd-e84d-423b-b319-d2224a1ce9ae@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1376950916 22407 69.95.181.76 (19 Aug 2013 22:21:56 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 19 Aug 2013 22:21:56 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 2466 Xref: number.nntp.dca.giganews.com comp.lang.ada:183073 Date: 2013-08-19T17:21:52-05:00 List-Id: "AdaMagica" wrote in message news:8e573dcd-e84d-423b-b319-d2224a1ce9ae@googlegroups.com... > On Sunday, August 18, 2013 11:05:47 PM UTC+2, sbelm...@gmail.com wrote: >> What is the size of Ada.Containers.Hash_Type intended to be? ... Is the >> intent that Hash_Type should be the native size of the machine (and the >> implementation is wrong/advice is vague), or that it actually should be >> 32-bit if possible? > > See AARM A.18.1(8.b/2). Looks like ist should be the native size. But it's > only advice. My recollection is that we said that with the intent that we didn't want it to be smaller than 32-bits unless there was a good reason (like no 32-bit math on the target). I don't think there was any intent to suggest that it ought to be larger (it's not practical to store more than 2**32 items in an Ada container). There's not much point anyway; you can't directly hash 32-bit signed integers in a 32-bit hash value without resorting to Unchecked_Conversion, and then you've already completely left the realm of safe and portable (neither Integer nor Hash_Type has a defined size by the RM). Randy.