Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

We have phasers, I vote we blast 'em! -- Bailey, "The Corbomite Maneuver", stardate 1514.2


devel / comp.lang.ada / Ada array contiguity.

SubjectAuthor
* Ada array contiguity.Rod Kay
+* Re: Ada array contiguity.J-P. Rosen
|`* Re: Ada array contiguity.Niklas Holsti
| +- Re: Ada array contiguity.Dmitry A. Kazakov
| `* Re: Ada array contiguity.J-P. Rosen
|  `* Re: Ada array contiguity.Niklas Holsti
|   +- Re: Ada array contiguity.Dmitry A. Kazakov
|   `- Re: Ada array contiguity.J-P. Rosen
+- Re: Ada array contiguity.Jeffrey R.Carter
`- Re: Ada array contiguity.Rod Kay

1
Ada array contiguity.

<tst8h6$de2q$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9344&group=comp.lang.ada#9344

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Ada array contiguity.
Date: Mon, 20 Feb 2023 00:34:55 +1100
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <tst8h6$de2q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Feb 2023 13:34:30 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="55128041d2fa000a745a8eca57bbb5b9";
logging-data="440410"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PDt7QFElolZyhBCmG+wewwmwGJnH3NGs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.7.2
Cancel-Lock: sha1:FeuovkF+cwxK8CIgSY84VStXJ0k=
Content-Language: en-US
 by: Rod Kay - Sun, 19 Feb 2023 13:34 UTC

Hi all,

I've been told that Ada array elements are not guaranteed to be
contiguous unless the 'Convention C' aspect is applied.

Is this correct ?

Regards.

Re: Ada array contiguity.

<tstbm6$doua$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9345&group=comp.lang.ada#9345

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rosen@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Sun, 19 Feb 2023 15:28:23 +0100
Organization: Adalog
Lines: 21
Message-ID: <tstbm6$doua$1@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 19 Feb 2023 14:28:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="2a2a8bfd02c78e11aee82bc56aeb068e";
logging-data="451530"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19l36ZldQsLemFDLoQrZJaH"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:CBPkKnYvUCceB4NW6Z88a2GXezE=
In-Reply-To: <tst8h6$de2q$1@dont-email.me>
Content-Language: en-US, fr
 by: J-P. Rosen - Sun, 19 Feb 2023 14:28 UTC

Le 19/02/2023 à 14:34, Rod Kay a écrit :
> Hi all,
>
>    I've been told that Ada array elements are not guaranteed to be
> contiguous unless the 'Convention C' aspect is applied.
>
>    Is this correct ?

The strength of Ada is that it protects you from all implementation
details, thus allowing compilers to choose the most efficient
implementation. Therefore, the answer is yes.

(BTW: try to find a definition of "contiguous". At byte level? At word
level? What if the element does not fill a byte?)

--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
https://www.adalog.fr https://www.adacontrol.fr

Re: Ada array contiguity.

<k5erquF5lhmU2@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9347&group=comp.lang.ada#9347

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Sun, 19 Feb 2023 16:59:42 +0200
Organization: Tidorum Ltd
Lines: 39
Message-ID: <k5erquF5lhmU2@mid.individual.net>
References: <tst8h6$de2q$1@dont-email.me> <tstbm6$doua$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 1SYy15ddI+kyyoR1I+Ny2wYeJ4fHV/WlQUOIv2eWyZilndNHQr
Cancel-Lock: sha1:L4+34yDxBOQ4jU81429lMWYlw2E=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Content-Language: en-US
In-Reply-To: <tstbm6$doua$1@dont-email.me>
 by: Niklas Holsti - Sun, 19 Feb 2023 14:59 UTC

On 2023-02-19 16:28, J-P. Rosen wrote:
> Le 19/02/2023 à 14:34, Rod Kay a écrit :
>> Hi all,
>>
>>     I've been told that Ada array elements are not guaranteed to be
>> contiguous unless the 'Convention C' aspect is applied.
>>
>>     Is this correct ?
>
> The strength of Ada is that it protects you from all implementation
> details, thus allowing compilers to choose the most efficient
> implementation. Therefore, the answer is yes.

I tried to find a rule on "contiguity" in the Ada 2022 RM, but failed.
Can you point to one? Perhaps this rule is a consequence of C standard
rules for arrays (pointer arithmetic), and the general idea that Ada
should allow Convention C for a type only if that type is really
compatible with the C compiler (in question).

For a constrained array type I would choose to specify the size of the
component type, and the size of the array type to be the length of the
array times the component size. That should (also) ensure that the
elements are stored contiguously (if the Ada compiler accepts this size
specification).

It seems (RM B.3(62.4/3)) that Ada compilers are not required to support
Convention C for unconstrained array types. RM B.3 (Interfacing with
C/C++) declares such types with the Pack aspect, but that may or may not
(AIUI) give a contiguous representation.

> (BTW: try to find a definition of "contiguous". At byte level? At word
> level? What if the element does not fill a byte?)

Indeed. But it seems to me that Arr'Size = Arr'Length * Comp'Size is the
meaning usually intended for programming purposes.

Re: Ada array contiguity.

<tste0q$bdnn$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9348&group=comp.lang.ada#9348

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Sun, 19 Feb 2023 16:08:09 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <tste0q$bdnn$2@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me> <tstbm6$doua$1@dont-email.me>
<k5erquF5lhmU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Feb 2023 15:08:11 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b688fff65d5e218a4c1e9cadbb53e098";
logging-data="374519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/78/AXROZVwsXlPB9hXF1CQVucc5Vh/NE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:0c2TWjRSd2aVq7HSGRbTovtCjAs=
Content-Language: en-US
In-Reply-To: <k5erquF5lhmU2@mid.individual.net>
 by: Dmitry A. Kazakov - Sun, 19 Feb 2023 15:08 UTC

On 2023-02-19 15:59, Niklas Holsti wrote:
> On 2023-02-19 16:28, J-P. Rosen wrote:

>> (BTW: try to find a definition of "contiguous". At byte level? At word
>> level? What if the element does not fill a byte?)
>
> Indeed. But it seems to me that Arr'Size = Arr'Length * Comp'Size is the
> meaning usually intended for programming purposes.

Rather: the bit offset of an element is a linear function of its position.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Ada array contiguity.

<tstl6i$erb0$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9349&group=comp.lang.ada#9349

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rosen@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Sun, 19 Feb 2023 18:10:44 +0100
Organization: Adalog
Lines: 15
Message-ID: <tstl6i$erb0$1@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me> <tstbm6$doua$1@dont-email.me>
<k5erquF5lhmU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 19 Feb 2023 17:10:42 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="52a11a1dc0de377fb3af0a83b81dc5c7";
logging-data="486752"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FYD+RvqEHmsanQQXnwRn/"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:uEZaiHQmHMXMn+7ZOQbxzzGiR3A=
In-Reply-To: <k5erquF5lhmU2@mid.individual.net>
Content-Language: en-US, fr
 by: J-P. Rosen - Sun, 19 Feb 2023 17:10 UTC

Le 19/02/2023 à 15:59, Niklas Holsti a écrit :
>> (BTW: try to find a definition of "contiguous". At byte level? At word
>> level? What if the element does not fill a byte?)
>
>
> Indeed. But it seems to me that Arr'Size = Arr'Length * Comp'Size is the
> meaning usually intended for programming purposes.

Certainly not if Comp'Size is not an integer number of bytes.
--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
https://www.adalog.fr https://www.adacontrol.fr

Re: Ada array contiguity.

<k5f625F5lhmU3@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9350&group=comp.lang.ada#9350

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Sun, 19 Feb 2023 19:54:13 +0200
Organization: Tidorum Ltd
Lines: 57
Message-ID: <k5f625F5lhmU3@mid.individual.net>
References: <tst8h6$de2q$1@dont-email.me> <tstbm6$doua$1@dont-email.me>
<k5erquF5lhmU2@mid.individual.net> <tstl6i$erb0$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net uooDKW1BN3iBzcdLVf5hogHRzGwDs3gFZUsKIt6c9sp7onjuD4
Cancel-Lock: sha1:KiyZz6guZayHSuWs7otIUljS9y4=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Content-Language: en-US
In-Reply-To: <tstl6i$erb0$1@dont-email.me>
 by: Niklas Holsti - Sun, 19 Feb 2023 17:54 UTC

On 2023-02-19 19:10, J-P. Rosen wrote:
> Le 19/02/2023 à 15:59, Niklas Holsti a écrit :
>>> (BTW: try to find a definition of "contiguous". At byte level? At
>>> word level? What if the element does not fill a byte?)
>>
>>
>> Indeed. But it seems to me that Arr'Size = Arr'Length * Comp'Size is
>> the meaning usually intended for programming purposes.
>
> Certainly not if Comp'Size is not an integer number of bytes.

I'm not so certain. By choosing various roundings-up of the component
size, you can choose between "bit-contiguous", "byte-contiguous", etc.

For example, bit-contiguous with 2-bit components:

type Comp is (A, B, C, D) with Size => 2;

type Arr is array (1 .. 10) of Comp
with Pack, Size => 10 * Comp'Size;

Nybble-contiguous with Comp'Size => 4, byte- (octet-) contiguous with
Comp'Size => 8, etc.

(However, I haven't checked that eg. GNAT does the "right thing" with
such Size clauses, just that it accepts them. It does require the Pack
aspect for the array type when Comp'Size is not a multiple of 8.)

On 2023-02-19 17:08, Dmitry A. Kazakov wrote:
> On 2023-02-19 15:59, Niklas Holsti wrote:
>> On 2023-02-19 16:28, J-P. Rosen wrote:
>
>>> (BTW: try to find a definition of "contiguous". At byte level?
>>> At word level? What if the element does not fill a byte?)
>>
>> Indeed. But it seems to me that Arr'Size = Arr'Length * Comp'Size
>> is the meaning usually intended for programming purposes.
>
> Rather: the bit offset of an element is a linear function of its
> position.

That is ordering by index, but not contiguity: there may still be gaps
between elements. However, I assume you meant that the slope of the
linear function equals the component size, and then it includes contiguity.

The relationship of index order to memory-location order is certainly an
aspect that should be considered when interfacing to C or HW.

Pet peeve: on more than one occasion I have been disappointed that Ada
representation clauses do not let me specify the index-order of packed
array elements in a word, relative to the bit-numbering order, and I
have had to fall back to using several scalar-type record components, c1
... c7 say, instead of one array-type component, c(1..7).

Re: Ada array contiguity.

<tstrtn$bdnn$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9351&group=comp.lang.ada#9351

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Sun, 19 Feb 2023 20:05:28 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <tstrtn$bdnn$3@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me> <tstbm6$doua$1@dont-email.me>
<k5erquF5lhmU2@mid.individual.net> <tstl6i$erb0$1@dont-email.me>
<k5f625F5lhmU3@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Feb 2023 19:05:27 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b688fff65d5e218a4c1e9cadbb53e098";
logging-data="374519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197v7jCDwLKeEFEdppfn8G7atKNYMAAI18="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:VQ8J2W9e385SBXfYILgY6blHAHo=
Content-Language: en-US
In-Reply-To: <k5f625F5lhmU3@mid.individual.net>
 by: Dmitry A. Kazakov - Sun, 19 Feb 2023 19:05 UTC

On 2023-02-19 18:54, Niklas Holsti wrote:
> On 2023-02-19 17:08, Dmitry A. Kazakov wrote:

>> Rather: the bit offset of an element is a linear function of its
>> position.
>
> That is ordering by index, but not contiguity: there may still be gaps
> between elements. However, I assume you meant that the slope of the
> linear function equals the component size, and then it includes contiguity.

No gaps = packed = the most dense representation.

Contiguity is rather that the gaps are regular and can be considered a
part of each element. E.g. a video buffer with strides is not contiguous.

> The relationship of index order to memory-location order is certainly an
> aspect that should be considered when interfacing to C or HW.

An definition of contiguous array equivalent to linearity is that the
array body representation is isomorphic to slicing.

> Pet peeve: on more than one occasion I have been disappointed that Ada
> representation clauses do not let me specify the index-order of packed
> array elements in a word, relative to the bit-numbering order, and I
> have had to fall back to using several scalar-type record components, c1
> .. c7 say, instead of one array-type component, c(1..7).

This is as blasphemous as asking for n-D slices... (:-))

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Ada array contiguity.

<tsu69s$gfej$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9352&group=comp.lang.ada#9352

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (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
Lines: 26
Message-ID: <tsu69s$gfej$1@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me>
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: <tst8h6$de2q$1@dont-email.me>
 by: Jeffrey R.Carter - Sun, 19 Feb 2023 22:02 UTC

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

Re: Ada array contiguity.

<tsv6h4$mi2b$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9353&group=comp.lang.ada#9353

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rosen@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Mon, 20 Feb 2023 08:12:41 +0100
Organization: Adalog
Lines: 31
Message-ID: <tsv6h4$mi2b$1@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me> <tstbm6$doua$1@dont-email.me>
<k5erquF5lhmU2@mid.individual.net> <tstl6i$erb0$1@dont-email.me>
<k5f625F5lhmU3@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 20 Feb 2023 07:12:36 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="cb32f51e92c92af3b69c3041a7dc7531";
logging-data="739403"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rhHozos1SH92sX338paTc"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:KT73SLBL6wRymeq98kQ81IpmSIg=
In-Reply-To: <k5f625F5lhmU3@mid.individual.net>
Content-Language: en-US, fr
 by: J-P. Rosen - Mon, 20 Feb 2023 07:12 UTC

Le 19/02/2023 à 18:54, Niklas Holsti a écrit :
> On 2023-02-19 19:10, J-P. Rosen wrote:
>> Le 19/02/2023 à 15:59, Niklas Holsti a écrit :
>>> Indeed. But it seems to me that Arr'Size = Arr'Length * Comp'Size is
>>> the meaning usually intended for programming purposes.
>>
>> Certainly not if Comp'Size is not an integer number of bytes.
>
> I'm not so certain. By choosing various roundings-up of the component
> size, you can choose between "bit-contiguous", "byte-contiguous", etc.
>
> For example, bit-contiguous with 2-bit components:
>
>    type Comp is (A, B, C, D) with Size => 2;
>
>    type Arr is array (1 .. 10) of Comp
>       with Pack, Size => 10 * Comp'Size;
>
> Nybble-contiguous with Comp'Size => 4, byte- (octet-) contiguous with
> Comp'Size => 8, etc.
>
Of course, if you add representation clauses, the compiler will obey
them. But the OP's question was whether it was /guaranteed/ to have
contiguous representation, and the answer is no - for good reasons.

--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
https://www.adalog.fr https://www.adacontrol.fr

Re: Ada array contiguity.

<ttnjhm$3v46h$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9395&group=comp.lang.ada#9395

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Re: Ada array contiguity.
Date: Thu, 2 Mar 2023 00:22:25 +1100
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <ttnjhm$3v46h$1@dont-email.me>
References: <tst8h6$de2q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Mar 2023 13:21:58 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="fca8f4947bc451b23e74f69ed4afd604";
logging-data="4165841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GZg+qs3j/WbjeWCp3NK1FvxxIX/0QIw8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:qBBXt7eZIfXvI9tm3rMwIXLFyR8=
In-Reply-To: <tst8h6$de2q$1@dont-email.me>
Content-Language: en-US
 by: Rod Kay - Wed, 1 Mar 2023 13:22 UTC

Thank you all for the replies.

To summarise then, contiguity is not guaranteed unless the array is of
convention C, convention Fortran or representation clauses are applied.

Regards.


devel / comp.lang.ada / Ada array contiguity.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor