comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Questions
Date: 27 Apr 2003 12:02:35 -0400
Date: 2003-04-27T12:02:35-04:00	[thread overview]
Message-ID: <wcc3ck4nd2c.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: b8bpdp$8a20o$1@ID-25716.news.dfncis.de

"Nick Roberts" <nickroberts@blueyonder.co.uk> writes:

> "Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
> news:wcc7k9mi4rb.fsf@shell01.TheWorld.com...
> 
> > Jakub Zawadzki <darkjames@poczta.onet.pl> writes:
> >
> > > It's guestions from my friend
> > > Emaix>I have a question. Does a String(1..X) occupy X bytes always, no
> > > Emaix> matter what actual length the string has got?
> >
> > Heh?  The length of the string *is* X.  So yes, it occupies X bytes
> > (plus whatever dope is necessary).
> 
> Sometimes a srting such as, for example, defined by String(1..10), will
> occupy 20 or 40 bytes (plus 'dope information'), unless pragma Pack is
> applied to it. This is because normally the compiler will allocate one
> 'storage element' per character (so as to maximise speed of access to it)
> and on some target machines storage elements are 16 or 32 bits in size.
> (Some unusual machines have other sizes of storage element.)

First, I'm willing to bet that the OP is not interested in such
machines.

Second, pragma Pack applies to type String, in all implementations of
Ada, and the requirements on Pack mean 4-chars-per-word on a
32-bit-word-addressable machine.

I think you (Nick) and I have both missed what the OP is getting at.
Perhaps he should clarify the question, perhaps with an example that
illustrates the point...

- Bob



  reply	other threads:[~2003-04-27 16:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 17:20 Questions Jakub Zawadzki
2003-04-22 19:59 ` Questions Stephen Leake
2003-04-22 21:47 ` Questions Robert A Duff
2003-04-25 16:57   ` Questions Nick Roberts
2003-04-27 16:02     ` Robert A Duff [this message]
2003-04-28 14:20       ` Questions Nick Roberts
     [not found] <mailman.0.1051099700.13478.comp.lang.ada@ada.eu.org>
2003-04-23 17:18 ` Questions tmoran
  -- strict thread matches above, loose matches on Subject: below --
1999-11-11  0:00 Questions Nobat
1999-11-11  0:00 ` Questions Tucker Taft
1999-11-11  0:00   ` Questions nobat
1999-11-11  0:00   ` Questions David Botton
1999-11-11  0:00   ` Questions nobat
1991-11-05 12:58 Questions Hugh Dunne
replies disabled

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