comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Problem taking 'Size of large array (gnat)
Date: 2000/09/13
Date: 2000-09-13T00:00:00+00:00	[thread overview]
Message-ID: <wcchf7jamek.fsf@world.std.com> (raw)
In-Reply-To: 39C00504.65A7A9C@linuxchip.demon.co.uk

Dr Adrian Wrigley <amtw@linuxchip.demon.co.uk> writes:

> with Text_IO; use Text_IO;
> 
> procedure ShowSize is
> 
>    type Big is array (0 .. 70_000_000) of Float;
>    type Long is range 0 .. 2**63 - 1;
>    X : Long;
> 
> begin
> 
>    X := Big'Size; -- Constraint error here!

This looks like a compiler bug to me.  Big'Size is not a static
expression, but RM-3.5.4(14) defines the base range to be System.Min_Int
.. System.Max_Int.  Calculations can't overflow unless they go outside
the base range of the type.  The fact that your compiler allowed the
declaration of Long proves that System.Max_Int is at least 2**63-1.
In fact, I believe that System.Max_Int is exactly 2**63-1 in all
versions of GNAT.

- Bob




      reply	other threads:[~2000-09-13  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-13  0:00 Problem taking 'Size of large array (gnat) Dr Adrian Wrigley
2000-09-13  0:00 ` Robert A Duff [this message]
replies disabled

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