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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,2478ea1b71f848e3 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.66.80.4 with SMTP id n4mr1740027pax.7.1351478370996; Sun, 28 Oct 2012 19:39:30 -0700 (PDT) Path: s9ni66434pbb.0!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.swapon.de!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: =?utf-8?B?R05BVCBkb2luZyBtYWNyb+KAkWV4cGFuc2lvbj8gKFByZS9Qb3N0IGNvbmQ=?= =?utf-8?B?aXRpb25zKQ==?= Date: Wed, 24 Oct 2012 19:20:32 +0200 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: qMb93YQAAEXAn86i0hBe/g.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.02 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 X-Received-Bytes: 2663 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-10-24T19:20:32+02:00 List-Id: Le Wed, 24 Oct 2012 18:45:27 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Le Wed, 24 Oct 2012 18:40:58 +0200, Yannick Duch=C3=AAne (Hibou57) = > a =C3=A9crit: > >> same snippet. Obviously, this does not stand for the reliable > Read =E2=80=9Cdoes not stand for the real thing=E2=80=9D. > >> type A_Type is mod 256; > > Sorry, forget to say about a second variation: replace the above with = = > `type A_Type is new Positive;` and there will be no more error at = > runtime (the first error, that is, with the useless package body still= = > there). That one is a lot weird. > More on that particular point. I you change `mod 256` into anything the = = modulo is above 256, not necessarily a power of two, as this works with = = `mod 257` two, then the bug disappears. The bug is there for any value = below and included, 256. I suspected the element size, and indeed, that's not really the modulo, = = but the size. Replace `type A_Type is mod 256;` with this, with an added= = representation clause: type A_Type is mod 256; for A_Type'Size use 16; The module is still 256, but now the size changed, and the bug is not = exposed. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity