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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35ee0472de38e833 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-13 07:44:10 PST Path: supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!fr.clara.net!heighliner.fr.clara.net!grolier!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "David Botton" Newsgroups: comp.lang.ada Subject: Re: Variable length raw-byte data Date: Wed, 13 Dec 2000 10:48:31 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: <00d101c0651c$24e3ea60$f8ffa8c0@dbdell2000> References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 976722249 6396 137.194.161.2 (13 Dec 2000 15:44:09 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 13 Dec 2000 15:44:09 +0000 (UTC) To: Return-Path: X-pair-Authenticated: 63.161.15.130 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0beta5 Precedence: bulk List-Id: comp.lang.ada mail<->news gateway Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: supernews.google.com comp.lang.ada:3064 Date: 2000-12-13T10:48:31-05:00 Since Byte_List is unconstrained is there not a potential for problem here with additional data associated with the type for bounds? > type Byte_List is array (Positive range <>) of Unsigned_8; Would this be a better solution: C_Thing (Length, Pointer) declare type Byte_List is array (1 .. Length) of Unsigned_8; Thing : Byte_List; for Thing'Address use Pointer; begin ... end; I frequently code the above as: C_Thing (Length, Pointer) declare type Byte_List is array (1 .. Length) of Unsigned_8; type Pointer_To_Byte_List is access all Byte_List; function To_Pointer_To_Byte_List is new Ada.Unchecked_Conversion (System.Address, Pointer_To_Byte_List); Thing : Pointer_To_Byte_List := To_Pointer_To_Byte_List (Pointer'Address); begin ... end; Is there a reason that using the for Thing'Address would be a better solution then the second method? David Botton