comp.lang.ada
 help / color / mirror / Atom feed
From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Re: unconstrainted arrays
Date: Wed, 17 Oct 2001 15:35:31 +0000 (UTC)
Date: 2001-10-17T15:35:31+00:00	[thread overview]
Message-ID: <slrn9sr99u.jv.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: 3BCDA15C.2976AF2@icn.siemens.de

* Alfred Hilscher wrote:
>type s (len : integer) is record
>            X,Y : Integer;
>            A : My_Array (1..Len);
>     end record;
>
>PTs : s (10);
>
>But this would add one extra component to the record (Len). Is there a
>way to avoid this extra component ? Maybe a pragma or rep-specs? Its
>encapsulated within a package body for HW handling where the extra
>component is unwanted.

type hw_s10 is record
    X,Y : Integer;
    A : My_Array (1..10);
end record;
for hw_s10 use record
   x at 0 range 0 .. 15;
   y at 2 range 0 .. 15;
   a at 4 range 0 .. 159;
end record;

If you are requireing a special layout, describe it directly. If the
discriminant occurs in the record at an other place: No problem:

type pascal_len is range 0 .. 255;
type pascal_string (len : pascal_len) is record
   value : String (1 .. len);
end record;
for pascal_string use record
   len at 0 range 0 .. 7;
end record;
pragma Pack (pascal_string);




  reply	other threads:[~2001-10-17 15:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-17 15:18 unconstrainted arrays Alfred Hilscher
2001-10-17 15:35 ` Lutz Donnerhacke [this message]
2001-10-17 16:28   ` Alfred Hilscher
2001-10-18  7:42     ` Lutz Donnerhacke
2001-10-18 11:03       ` Rep spec still not possible Petter Fryklund
2001-10-18 12:44         ` Lutz Donnerhacke
2001-10-18 17:10           ` Jeffrey Carter
2001-10-19 13:52             ` Exactly the prblem, how do we make a known constant value static? Petter Fryklund
2001-10-20  0:04               ` James Rogers
2001-10-20  2:53               ` Jeffrey Carter
2001-10-22  8:11                 ` We still don't know how to make a " Petter Fryklund
2001-10-17 16:09 ` unconstrainted arrays Claude SIMON
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox