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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1f57751d33f5dc3 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Problem taking 'Size of large array (gnat) Date: 2000/09/13 Message-ID: #1/1 X-Deja-AN: 669418764 Sender: bobduff@world.std.com (Robert A Duff) References: <39C00504.65A7A9C@linuxchip.demon.co.uk> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-09-13T00:00:00+00:00 List-Id: Dr Adrian Wrigley 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