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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!v17g2000vbb.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Use aggregates (Was: Allocation question) Date: Wed, 13 May 2009 09:38:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7b4408e9-386d-471b-aad5-9d26dde12682@v17g2000vbb.googlegroups.com> References: <4a07fc7a$0$2855$ba620e4c@news.skynet.be> <87prefhq04.fsf@nbi.dk> <62aa80a1-1c0b-4716-ab16-9b6243d97ff2@o27g2000vbd.googlegroups.com> <26af755b-0b90-429f-a688-86bf307da2b5@o20g2000vbh.googlegroups.com> NNTP-Posting-Host: 81.156.240.174 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242232727 5207 127.0.0.1 (13 May 2009 16:38:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 May 2009 16:38:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v17g2000vbb.googlegroups.com; posting-host=81.156.240.174; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.10) Gecko/2009042315 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5821 Date: 2009-05-13T09:38:47-07:00 List-Id: On May 12, 10:18=A0pm, "Randy Brukardt" wrote: > "Martin" wrote in message > > news:26af755b-0b90-429f-a688-86bf307da2b5@o20g2000vbh.googlegroups.com... > > >> This is not always a good idea. On some targets, GNAT places the > >> aggregate on the stack and this can raise a Storage_Error. In avionics > >> programs, I remember replacing aggregates with loops for this reason. > > >And not just GNAT...in fact, I'm struggling to remember a compiler > >that _doesn't_ do the "large and slow (and stupid?)" aggregate for > >assignment (or initialisation). > > You must have not used many Ada compilers. The current count is 7 (for my day job) + 3 (for home work). Cheers -- Martin