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: a07f3367d7,e55912fa8f040ab5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z24g2000yqb.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: GNAT GPL 2009 - issue with floating points? Date: Fri, 9 Oct 2009 15:44:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1d918375-9081-4e90-8abb-136f8e273622@z24g2000yqb.googlegroups.com> References: <4acf9ee2$0$23472$426a34cc@news.free.fr> <6d8f169d-5dc8-465c-9368-be91efc2de0f@v15g2000prn.googlegroups.com> <4acfb607$0$412$426a34cc@news.free.fr> NNTP-Posting-Host: 94.108.168.12 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1255128263 22823 127.0.0.1 (9 Oct 2009 22:44:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 9 Oct 2009 22:44:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z24g2000yqb.googlegroups.com; posting-host=94.108.168.12; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009061208 Iceweasel/3.0.12 (Debian-3.0.12-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8641 Date: 2009-10-09T15:44:23-07:00 List-Id: Damien Carbonne wrote on comp.lang.ada: > Adam Beneschan a =E9crit : > > On Oct 9, 1:36 pm, Damien Carbonne wrote: > >> Hi, > > >> When compiling the following sample code with GNAT GPL 2009 on Linux: > > >> generic > >> =A0 =A0 type Real is digits <>; > >> package Pack04 is > >> =A0 =A0 Size1 : constant :=3D Real'Size; > >> =A0 =A0 Size2 : constant Integer :=3D Real'Size; > >> end Pack04; > > >> I get this: > > >> -- pack04.ads:4:24: non-static expression used in number declaration > >> -- pack04.ads:4:28: size attribute is only static for scalar type (RM > >> 4.9(7,8)) > Do you mean that the formal generic parameter Real is not a scalar? > I'm certainly no an Ada expert, but I really find the message confusing. Real is scalar all right but it is not static; the first error message is explicit about that. I agree that the second message is confusing; it should read "size attribute is only static for a static scalar subtype (RM 4.9(7,8,26))". Generic formal subtypes are non-static. HTH -- Ludovic Brenta.