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!u16g2000pru.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: GNAT GPL 2009 - issue with floating points? Date: Fri, 9 Oct 2009 16:26:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7d4eb248-3730-4bf0-af51-72a062778510@u16g2000pru.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: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1255130774 32018 127.0.0.1 (9 Oct 2009 23:26:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 9 Oct 2009 23:26:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u16g2000pru.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8642 Date: 2009-10-09T16:26:13-07:00 List-Id: On Oct 9, 3:15=A0pm, Damien Carbonne wrote: > Adam Beneschan a =E9crit : > >> -- 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)) > > >> RM 3.5(1): "scalar types comprise enumeration types, integer types, an= d > >> real types." > > >> RM 3.5.6 (1): "Real types provide approximations to the real numbers, > >> with relative bounds on errors for floating point types, and with > >> absolute bounds for fixed point types." > > > Did you read the RM reference that the GNAT error message pointed you > > to??? > > Yes I did ! The RM reference says (in paragraph 6) that the attribute reference has to have a prefix that denotes a "static scalar subtype" (which is defined later on in 4.9). The GNAT message says just "scalar subtype"; as Ludovic points out, that could have been worded better and should probably have said "static scalar subtype". However, one should always trust the RM in preference to an error message, since the RM is a standard. Also, keep in mind that a "static" expression is basically one that the compiler can determine at compile time when it sees the expression, and in this case it can't, because it has no idea what sort of float will be used to instantiate the package. -- Adam