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,f9957894e0bdf128 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to put 200 into an integer sub-type of 16 bits (code included) Date: Wed, 14 Jan 2009 21:09:22 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <407ae64d-3cb3-4310-b59e-f1bbae9910a5@t39g2000prh.googlegroups.com> <71gqm49eatq868htrvd7eghm3m8su8kcbl@4ax.com> <7b017de2-951a-414a-8290-111353fe02f8@r15g2000prd.googlegroups.com> <46075a57-3445-44ae-b40e-dcad9e0e1fcf@v18g2000pro.googlegroups.com> <3d951e6e-c87d-4667-94ab-fcb312288e1d@r37g2000prr.googlegroups.com> <12837a65-dd6e-493f-91e8-4140d67237c2@z28g2000prd.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1231989101 25052 69.95.181.76 (15 Jan 2009 03:11:41 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 15 Jan 2009 03:11:41 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:3311 Date: 2009-01-14T21:09:22-06:00 List-Id: "Adam Beneschan" wrote in message news:12837a65-dd6e-493f-91e8-4140d67237c2@z28g2000prd.googlegroups.com... > On Jan 14, 3:09 pm, Martin wrote: >> On Jan 14, 9:16 pm, Adam Beneschan wrote: >> >> > Not necessarily. You can apply a 'Size clause to a subtype: >> >> > subtype Byte is Natural range 0 .. 255; >> > for Byte'Size use 8; >> >> Since when??? > > Since Ada 95 (I don't think this was allowed in Ada 83). See 13.1 > (8). GNAT may not allow this, but 13.1(20) gives implementations the > right to put their own restrictions on representation items. No, 13.3(48) says "Size may be specified for *first subtypes* ..." (emphasis mine). Nothing about specifying it for non-first subtypes. (There has been quite a bit of discussion about changing that, but it leads to uncomfortable issues with legality rules depending on representation - not enough people can live with that.) Randy.