comp.lang.ada
 help / color / mirror / Atom feed
From: sjw <simon.j.wright@mac.com>
Subject: Re: Null Range in Unconstrasined Array
Date: Wed, 9 Sep 2009 12:22:42 -0700 (PDT)
Date: 2009-09-09T12:22:42-07:00	[thread overview]
Message-ID: <51c7d71e-d71c-442c-aa47-55acb2ee0f6d@o9g2000yqj.googlegroups.com> (raw)
In-Reply-To: uk5088qig.fsf@stephe-leake.org

On Sep 9, 9:35 am, Stephen Leake <stephen_le...@stephe-leake.org>
wrote:
> Adam Beneschan <a...@irvine.com> 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). Also, if you stream it, it takes just 162 bytes on
the stream.



  parent reply	other threads:[~2009-09-09 19:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01  1:28 Null Range in Unconstrasined Array Rick
2009-09-01  3:11 ` Randy Brukardt
2009-09-01 14:50 ` Adam Beneschan
2009-09-01 15:34   ` Robert A Duff
2009-09-06 12:11     ` Peter C. Chapin
2009-09-06 12:41       ` Robert A Duff
2009-09-08 17:54         ` Adam Beneschan
2009-09-09  8:35           ` Stephen Leake
2009-09-09 13:00             ` Robert A Duff
2009-09-09 19:22             ` sjw [this message]
2009-09-10 23:24               ` Stephen Leake
replies disabled

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