comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Portability questions
Date: 2000/04/25
Date: 2000-04-25T00:00:00+00:00	[thread overview]
Message-ID: <wccr9btbusr.fsf@world.std.com> (raw)
In-Reply-To: 8e55k5$52s$1@nnrp1.deja.com

Robert Dewar <robert_dewar@my-deja.com> writes:

> In article <wccbt2ycni0.fsf@world.std.com>,
>   Robert A Duff <bobduff@world.std.com> wrote:
> 
> > Without pragma Import, the compiler can do what it likes
> > initialize B or not.  I suspect most compilers do not.  I
> > think compilers should not.
> 
> Why do you think that? This is a case where the quality and
> efficiency of the code is greatly improved by making sure
> that there are no unused garbage bits in the value, which can
> otherwise happen with packed arrays. This is very similar to
> the trade off choice of whether to clear garbage bits in records
> to speed up record comparisons.

Yes, you're right.  If there are gap bits in between components, then it
makes perfect sense for a compiler to set the whole thing to zero.

> > With pragma Import on B, I would consider it a bug for a
> > compiler to initialize B, although I'm not sure I can prove
> > that from the RM.
> 
> Most certainly pragma Import suppresses the initialization, and
> I find Bob's "not sure" here odd.

Well, I was just too lazy to look it up.  ;-)

- Bob




      reply	other threads:[~2000-04-25  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-24  0:00 Portability questions Wes Groleau
2000-04-25  0:00 ` Robert A Duff
2000-04-25  0:00   ` Robert Dewar
2000-04-25  0:00     ` Robert A Duff [this message]
replies disabled

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