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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: access-to-classwide has non-static size? Date: Fri, 27 Mar 2015 08:49:55 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="e362043f1eec5b72fb571caf32708303"; logging-data="21024"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sD0FXtKTesEO+c13CKgPQFb2GInPTIZU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:ZsQswQ92o1swHFWCoKqlvnzkz2k= sha1:yorD/ygiIdko2igBcMxK4NjzE4Q= Xref: number.nntp.giganews.com comp.lang.ada:192587 Date: 2015-03-27T08:49:55+00:00 List-Id: Simon Wright writes: > type Event_Base is abstract tagged limited private; > type Event_P is access all Event_Base'Class; > > ... > > package Event_Queues is new Ada.Containers.Bounded_Vectors > (Index_Type => Positive, > Element_Type => Event_P); > > ... > > protected type Dispatchable_Events is > ... > private > ... > The_Events : Event_Queues.Vector (Capacity => Capacity); > > and when compiling with the Ravenscar profile (GNAT GPL 2014, GCC 4.9.1, > GCC 5.0.0 20150208) the compiler says > > warning: component has non-static size > warning: creation of protected object of type "Dispatchable_Events" > will violate restriction No_Implicit_Heap_Allocations > > Is this (the non-static size part!) right? If I declare an Event_Queue.Vector at library level rather than in a PO I don't get the warnings. So this is a GNAT problem, maybe?