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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Re: storage error: stack overflow Date: Wed, 19 Aug 2015 10:12:53 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net A0oWpzdJcQYmiSgPD2rPvgyJlSZYrrvE6dooFel2qai6iQ0UCd Cancel-Lock: sha1:3hF/XMmXKzLAz9BQ0dFjJkA2nHM= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:27506 Date: 2015-08-19T10:12:53-03:00 List-Id: On 08/18/2015 11:16 AM, Jeffrey R. Carter wrote: > On 08/18/2015 05:23 AM, hreba wrote: >> >> I need an access type because in my real program TB is a tagged type and I need >> class-wide variables. > > You do not /need/ access types for this. Avoiding them requires some thought, > but that's what S/W engineers do. > >> Didn't know about extended return (the Ada 95 book was cheaper -:). But there is >> a problem: the TB in my original program is not only tagged, it is limited too >> (and New_TB is for initialization). So "foo.all:=..." is forbidden. > > If your type is limited then you will have to use an extended return for Ada > > 95. Does > > return Foo : access TB := > new TB'( (A => TA'(Name => To_Unbounded_String (Name) ) ); > > work? > This got me a GNAT BUG DETECTED message upon compilation. Will follow the request to send a bug report. I am happy with Egil's workaround. Thanks for your hints and help. -- Frank Hrebabetzky +55 / 48 / 3235 1106 Florianopolis, Brazil