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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5d624451bcaff335 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Null Range in Unconstrasined Array References: <76a9c14b-c573-4fd4-bbd8-7ab3bd078d79@j9g2000prh.googlegroups.com> <68f49a20-2142-46ee-bed8-e5b3cad398e0@l35g2000pra.googlegroups.com> <51c7d71e-d71c-442c-aa47-55acb2ee0f6d@o9g2000yqj.googlegroups.com> From: Stephen Leake Date: Thu, 10 Sep 2009 19:24:40 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:WQj9uBZr34OLPtI5Fn9EVQaKoWI= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 2c9db4aa98a50e197caa722934 Xref: g2news2.google.com comp.lang.ada:8277 Date: 2009-09-10T19:24:40-04:00 List-Id: sjw writes: > On Sep 9, 9:35�am, Stephen Leake > wrote: >> Adam Beneschan writes: >> > To elaborate on this a bit further: Suppose you define a record type >> > for reading a file with Ada.Direct_IO, that looks something like this: >> >> > � type Employee_Data is record >> > � � � Name � � : String (1 .. 50); >> > � � � Address1 : String (1 .. 40); >> > � � � Address2 : String (1 .. 40); >> > � � � City � � : String (1 .. 30); >> > � � � State � �: String (1 .. 2); >> > � � � ... >> > � end record; > >> It _could_ depend on whether there's a pragma Pack, or a >> representation clause, for the record. In the absence of such, I would >> expect the compiler to treat these components the same way it treats >> separate objects. Which means I would expect the bounds to be stored >> with the object. > > After leaving out the ..., GNAT allocates 162 bytes for this record > (no dope bytes). Ok, my expectations are duly updated :). > Also, if you stream it, it takes just 162 bytes on the stream. That's not surprising: LRM 13.13.2 says: 3 S'Write S'Write denotes a procedure with the following specification: 4/2 procedure S'Write( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : in T) 5 S'Write writes the value of Item to Stream. The value clearly does not include the bounds. -- -- Stephe