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!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Problem with Position of the enumeration Type Date: Thu, 24 Jan 2019 21:39:00 +0200 Organization: Tidorum Ltd 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 X-Trace: individual.net i1s2sGgRjwgKHuWh/PhADQyBy/9QX0JAKPuS2MSwovTFqe9fG/ Cancel-Lock: sha1:3E7HtLRMZnvQxjtyu05KeomlOeM= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:55362 Date: 2019-01-24T21:39:00+02:00 List-Id: On 19-01-24 18:43 , Jeffrey R. Carter wrote: > On 1/23/19 11:35 PM, Simon Wright wrote: >> Niklas Holsti writes: >> >>> Such rules also commonly say that such types should not be used as >>> array index types, because of the possible introduction of gaps in the >>> array representations. >> >> Not, it seems, with GNAT: > > This is not a language rule. I can find nothing in the ARM about > disallowing such types as array indices. So naturally GNAT and all other > compilers must support it. 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. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .