comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Krischik" <krischik@users.sourceforge.net>
Subject: Re: Discriminated types with default discriminants
Date: Fri, 04 Nov 2005 19:58:28 +0200
Date: 2005-11-04T19:58:28+02:00	[thread overview]
Message-ID: <op.szp9jqytz25lew@super> (raw)
In-Reply-To: sa4vez99jp6.fsf@snoopy.microcomaustralia.com.au

Am 04.11.2005, 05:27 Uhr, schrieb Brian May <bam@snoopy.apana.org.au>:

>>>>>> "Maciej" == Maciej Sobczak <no.spam@no.spam.com> 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



      parent reply	other threads:[~2005-11-04 17:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-03 15:50 Discriminated types with default discriminants Maciej Sobczak
2005-11-03 16:06 ` Martin Krischik
2005-11-03 23:10   ` Robert A Duff
2005-11-04  5:01     ` Jeffrey R. Carter
2005-11-03 16:21 ` Ed Falis
2005-11-03 17:28 ` Dmitry A. Kazakov
2005-11-03 18:51 ` Jeffrey R. Carter
2005-11-03 23:08   ` Robert A Duff
2005-11-04  0:08     ` Adam Beneschan
2005-11-29  2:49       ` Randy Brukardt
2005-12-02 18:22         ` Robert A Duff
2005-11-04  9:18   ` Maciej Sobczak
2005-11-04  3:27 ` Brian May
2005-11-04 13:09   ` Stephen Leake
2005-11-04 17:58   ` Martin Krischik [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