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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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,CP1252 Received: by 10.224.138.142 with SMTP id a14mr9179856qau.4.1351102586424; Wed, 24 Oct 2012 11:16:26 -0700 (PDT) Received: by 10.52.66.235 with SMTP id i11mr3125529vdt.7.1351102586386; Wed, 24 Oct 2012 11:16:26 -0700 (PDT) Path: r17ni57592152qap.0!nntp.google.com!x14no6920152qar.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Oct 2012 11:16:26 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.35; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.35 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4c21694e-456d-442f-9d57-da24ad8028bf@googlegroups.com> Subject: Re: GNAT doing macro-expansion? (Pre/Post conditions) From: Anh Vo Injection-Date: Wed, 24 Oct 2012 18:16:26 +0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: 2012-10-24T11:16:26-07:00 List-Id: On Wednesday, October 24, 2012 10:20:36 AM UTC-7, Hibou57 (Yannick Duch=EAn= e) wrote: > Le Wed, 24 Oct 2012 18:45:27 +0200, Yannick Duch=EAne (Hibou57) a =E9crit: > Le Wed, 24 Oct 2012 18:40:58 +0200, Yannick = Duch=EAne (Hibou57) > a =E9crit: > >> same snipp= et. Obviously, this does not stand for the reliable > Read =93does not stan= d for the real thing=94. > >> 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, t= hat is, with the useless package body still > there). That one is a lot wei= rd. > More on that particular point. I you change `mod 256` into anything t= he 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 belo= w and included, 256. I suspected the element size, and indeed, that's not r= eally 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'S= ize use 16; The module is still 256, but now the size changed, and the bug = is not exposed.>> You should file bug report for these problems. So far, I have filed two bug= reports at report@gnat.com when using GNAT-GPL-2012 to compile Ada 2012 co= des.