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,caabf5265fad78e5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!gegeweb.org!news.ecp.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: unsigned type Date: Tue, 30 Jun 2009 15:46:55 +0200 Organization: Adalog Message-ID: References: <4a48968a$0$31863$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1246360321 1820 195.25.228.57 (30 Jun 2009 11:12:01 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 30 Jun 2009 11:12:01 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:6757 Date: 2009-06-30T15:46:55+02:00 List-Id: anon a �crit : > As for confusing when the index type is defined as Positive, but the > compiler and runtime system allows zero. That's either a compiler Bug or a > total lack of reading the RM definition of the terms Natural and Positive types > for Adacore and the GNU GCC Ada maintainers. > The idea is that you don't check that bounds belong to the index subtype if the range is null (i.e., all null ranges are allowed). This is intended to avoid raising constraint_error if you declare a String(1..0) Note that it makes code generation for aggregates much more complicated in some cases - and I wrote the code generator for array aggregates in Ada-Ed v2, long ago. So it is not a bug, it doesn't prove that the index is natural, it's just the intended behaviour, designed in a way that makes user's life easier - at the cost of compiler writers' life. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr