comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: GNAT GPL 2009 - issue with floating points?
Date: Fri, 9 Oct 2009 16:26:13 -0700 (PDT)
Date: 2009-10-09T16:26:13-07:00	[thread overview]
Message-ID: <7d4eb248-3730-4bf0-af51-72a062778510@u16g2000pru.googlegroups.com> (raw)
In-Reply-To: 4acfb607$0$412$426a34cc@news.free.fr

On Oct 9, 3:15 pm, Damien Carbonne <damien.carbo...@free.fr> wrote:
> Adam Beneschan a écrit :
> >> -- 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, and
> >> 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




  parent reply	other threads:[~2009-10-09 23:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09 20:36 GNAT GPL 2009 - issue with floating points? Damien Carbonne
2009-10-09 21:06 ` Adam Beneschan
2009-10-09 22:15   ` Damien Carbonne
2009-10-09 22:44     ` Ludovic Brenta
2009-10-10  6:33       ` Damien Carbonne
2009-10-10 14:55       ` Samuel Tardieu
2009-10-10 16:12         ` Ludovic Brenta
2009-10-10 16:38         ` Damien Carbonne
2009-10-09 23:26     ` Adam Beneschan [this message]
2009-10-10  6:39       ` Damien Carbonne
2009-10-10  7:16         ` Dmitry A. Kazakov
2009-10-11  9:33           ` Dirk Herrmann
2009-10-11 10:27             ` Dmitry A. Kazakov
2009-10-12 23:26               ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox