comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: GNAT bug with respect to an Implementation Advise
Date: Wed, 13 Dec 2000 18:49:09 -0600
Date: 2000-12-13T18:49:09-06:00	[thread overview]
Message-ID: <jNUZ5.1627$oK3.455220@homer.alpha.net> (raw)
In-Reply-To: 87aea0xfgk.fsf@deneb.enyo.de

Florian Weimer wrote in message <87aea0xfgk.fsf@deneb.enyo.de>...

>GNAT is following the IA, but the IA is surprising.  There's also an
>AI on this issue, which involved a lot of discussion.  (Some vendors
>do not follow the IA and want to change the standard to officially
>sanction the derivation, IMHO.

No, that's an oversimplification. The problem is that the Ada 95
standard never specifies what the base range is. That is left up to
compilers. Thus, there is no way to tell how many bytes are written out
by a particular type. (There is also the issue that you can't read
hetrogenus data structures defined outside of Ada at all without some
control over this.)

For instance, if you have the type:
    type Byte is range 0 .. 255;
    for Byte'Size is 8;

the base range might be:
    Byte'Base'First = -32768, Byte'Base'Last = 32767 (i.e. 16 bits
read/written by streams)
or it might be
    Byte'Base'First = -2**31, Byte'Base'Last = 2**31-1 (i.e. 32 bits
read/written by streams)
or something else again (say on a 24-bit machine).

These are all legal, correct implementations of Ada, and even if all of
the implementations follow the IA, they won't be compatible.

                Randy.






  reply	other threads:[~2000-12-14  0:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-13 15:53 GNAT bug with respect to an Implementation Advise Jeff Creem
2000-12-13 19:56 ` Florian Weimer
2000-12-14  0:49   ` Randy Brukardt [this message]
2000-12-14  1:40 ` Robert Dewar
2000-12-14  2:40   ` Jeff Creem
2000-12-14 22:47     ` Randy Brukardt
2000-12-15 22:00       ` Randy Brukardt
replies disabled

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