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: 103376,c022fc5445abd13d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!dotsrc.org!news.dotsrc.org!not-for-mail Date: Fri, 04 Nov 2005 19:58:28 +0200 Subject: Re: Discriminated types with default discriminants Newsgroups: comp.lang.ada References: From: "Martin Krischik" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera M2/8.50 (Win32, build 7700) Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 213.154.204.74 X-Trace: news.sunsite.dk DXC=?AXV22VNTlh]OI4DlPLEfeYSB=nbEKnkk9; Am 04.11.2005, 05:27 Uhr, schrieb Brian May : >>>>>> "Maciej" == Maciej Sobczak writes: > > Hello, > > The 2nd warning has already been explained in detail, however I am > still confused with the first warning: > > Maciej> Compiler (GNAT) gives me two warnings: > > Maciej> 5. Value : String (1..Size); > Maciej> | > >>>> warning: creation of object of this type may raise > Maciej> Storage_Error > > Why does this warning go away when using an unbounded subtype? Doesn't > the issue still exist? Indeed it still exists - only the compiler did not detect it right away. Note: Warnings like this are usualy created by the optimizer and are not part of the language. > Maciej> I can get rid of the first warning with this: > > Maciej> subtype MyInt is Integer; > Maciej> type Discriminated(Size : MyInt := 10) is > Maciej> -- ... Martin