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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5d4ade2fd8fd67c6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: Legit Warnings or not Date: Thu, 21 Jul 2011 14:17:48 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <531193e0-3305-4292-9ed8-0176226c1d00@x12g2000yql.googlegroups.com> Reply-To: anon@anon.org NNTP-Posting-Host: FvZnai83ePJpXxlpTkdfmg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news2.google.com comp.lang.ada:21236 Date: 2011-07-21T14:17:48+00:00 List-Id: This is funny. Because if you add definition of Positive subtype Positive is Integer range 1 .. Integer'Last ; -- or -- copied from created standard ( gnat standard ) subtype Positive is Integer range 1 .. +(2 ** 31 - 1); it stops the warning message. So, its a compile error. Even GNAT 3.10 .. 2007 | 2011 has this error so this one goes back a few years. In <531193e0-3305-4292-9ed8-0176226c1d00@x12g2000yql.googlegroups.com>, Anh Vo writes: >package Warnings_Legit is > > type Warned_Person (Size : Positive := 10) is -- Warnings issued >here > record > Name : String (1 .. Size); > end record; > > type Acceptable_Person (Size : Positive) is > record > Name : String (1 .. Size); > end record; > >end Warnings_Legit; > >The code segment above triggers a warnings message 'creation of >"Warned_Person" object may raise Storage_Error' at line 3 as marked. >However, no warnings is issued at line 8. The difference between them >is default discriminant. I am using GNAT-GPL-2011. > >Is this warnings legitimate? If yes, why line 8 is OK. Otherwise, >should it be a bug? > >Anh Vo