comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Representation clauses and streams
Date: 2000/01/03
Date: 2000-01-03T00:00:00+00:00	[thread overview]
Message-ID: <84qjto$e9l$1@nnrp1.deja.com> (raw)
In-Reply-To: wcc3dsf9xrn.fsf@world.std.com

In article <wcc3dsf9xrn.fsf@world.std.com>,
  Robert A Duff <bobduff@world.std.com> wrote:
> Robert Dewar <robert_dewar@my-deja.com> writes:
>
> > Apparently some other compilers failed to follow the RM
advice
> > in the first place, which is what is giving rise to the push
> > to revise the language here.
>
> I don't think other compilers failed to follow the RM advice.
I think
> what happened is that different compilers chose different base
ranges,
> so even if all compilers follow the Advice, they don't all get
the same
> answer.  Users griped about this, which caused the ARG to get
involved.


That's quite right, some compilers used different base ranges.
Sorry for getting this confused in my previous post.

I actually think that we are mostly OK here. I think that
GNAT basically will do the right thing according to the modified
IA with changes after all (I was confused on this point).

Here is the specific case.

If you say

   type x is range -128 .. +127;
   for x'size use 8;

then (actually with or without the size clause), both the
base type and the first subtype are 8 bits, so GNAT stream
I/O uses 8 bits as expected.

Some other compiler legitimately, but not very helpfully in
this case, chose a base of 32 bits for type x above, and as
a result used four bytes for the stream which was not what
was wanted.

So I think there is no problem with GNAT here after all, or
more properly, the adjustment to GNAT to "agree" with the
new IA will not have a major impact.


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-01-03  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-29  0:00 Representation clauses and streams Florian Weimer
1999-12-29  0:00 ` Robert Dewar
1999-12-30  0:00   ` Florian Weimer
2000-01-02  0:00     ` Tucker Taft
2000-01-03  0:00       ` Robert Dewar
2000-01-03  0:00         ` Robert A Duff
2000-01-03  0:00           ` Robert Dewar [this message]
2000-01-04  0:00       ` Florian Weimer
2000-01-04  0:00         ` Robert Dewar
1999-12-29  0:00 ` Ted Dennison
1999-12-29  0:00   ` Florian Weimer
replies disabled

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