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: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Problem with Position of the enumeration Type Date: Thu, 24 Jan 2019 21:29:52 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <3d782720-227d-4d86-b403-eacbd1b9d0d2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 24 Jan 2019 20:29:54 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="53af55b10e29090da1d6967fe29985f2"; logging-data="27475"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zLdHdKQfemyCDEw0P63pvbq3m5iwE2UQ=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cancel-Lock: sha1:vPiTBwKwrLERts3MJzDpKl+hfUg= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:55363 Date: 2019-01-24T21:29:52+01:00 List-Id: On 1/24/19 8:39 PM, Niklas Holsti wrote: > > All compliant compilers, yes. But the question was: if the enumerated index type > has gaps in its representation, can there be corresponding gaps (unused > intervals of storage units) between the elements of the array, as represented in > memory? Or must the elements still be contiguous, except for alignment padding? > > In other words, can the compiled code compute the offset of an array element > directly from the representation of the enumerated index value (causing gaps in > the array), or must it always first compute the position number of that value, > and then compute the offset from the position number (suppressing gaps)? > > This discussion has not yet pointed to an ARM rule that forbids gaps in the > array's representation. In the absence of representation specifications (Component_Size, Pack, Convention), AFAIK the only thing that the ARM says about the implementation of arrays is that multidimensional arrays must be in row-major order. Other than that, it's up to the compiler, so any array could have "gaps", regardless of the index subtypes. -- Jeff Carter "When and now is this guitar piece from Stottlemeyer? Yes, it's with Mr. Dog in Gertrude's pinball forest." The World's Funniest Joke 133