From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Ada array contiguity. Date: Sun, 19 Feb 2023 23:02:36 +0100 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 19 Feb 2023 22:02:36 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="b5a60c3440c50ec5b065cabc78a244c4"; logging-data="540115"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bYu/STotjxuDFTA/Hi1XMkxT7AYwSQFk=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cancel-Lock: sha1:FXCf+dqg/brUtHcvSENcFnwtRqk= Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64948 List-Id: On 2023-02-19 14:34, Rod Kay wrote: > >    I've been told that Ada array elements are not guaranteed to be contiguous > unless the 'Convention C' aspect is applied. The ARM says little about how the compiler represents objects in the absence of representation clauses. However, ARM 13.7(12) (http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-13-7-1.html#I5653) says, "Storage_Array represents a contiguous sequence of storage elements." ARM 13.9(17/3) (http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-13-9.html#I5679) says that a compiler that supports Unchecked_Conversion should use a contiguous representation for certain constrained array subtypes. Using convention Fortran should also ensure a contiguous representation, add can apply (unlike convention C) to multidimensional arrays. -- Jeff Carter "All citizens will be required to change their underwear every half hour. Underwear will be worn on the outside, so we can check." Bananas 29