comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Enhancement needed
Date: Mon, 25 Sep 2000 04:26:16 GMT
Date: 2000-09-25T04:26:16+00:00	[thread overview]
Message-ID: <8qmk4l$bb2$1@nnrp1.deja.com> (raw)
In-Reply-To: 39C564E4.C976F096@telepath.com

In article <39C564E4.C976F096@telepath.com>,
  Ted Dennison <dennison@telepath.com> wrote:
> I believe the entire issue was what the compiler can do in the
> *absence* of a rep clause. Its pretty clear that it needs to
> honor any record rep clause, or die trying. But it was
> suprising to some that in *absense* of a rep clause,
> compilers still aren't supposed to rearrange record fields to
> make a size clause attainable.

Well the RM is a good antidote to suprise here. Once again,
the relevant section of the RM is 13.3(53):

53   A Size clause on a composite subtype should not affect the
internal layout of components.

This is implementation advice, since there is no easy way to
formalize this as a formal semantic requirement, because the
formal semantics have nothing to say about default data
representation (for example a compiler that rearranged record
fields only in leap years is a conforming, though silly,
compiler -- IA is basically about preventing silliness :-)

In this case, the IA is well taken, because if size could
affect the internal layout of components, this could result
in expensive implicit conversions.

At the very least, compilers that follow implementation advice
in the RM should not surprise you by following this advice :-)




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



      parent reply	other threads:[~2000-09-25  4:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-12 12:51 Enhancement needed (was strange record size ?) Michael Pickett
2000-09-12 23:03 ` John McCabe
2000-09-13  0:00   ` Michael Pickett
2000-09-13  0:00 ` Enhancement needed Nick Roberts
2000-09-13  0:00   ` Robert A Duff
     [not found]   ` <feMY0DAzxTw5EwOG@ntlworld.com>
2000-09-17  0:00     ` Samuel T. Harris
2000-09-17  0:00       ` Ted Dennison
2000-09-18  0:00         ` Samuel T. Harris
2000-09-25  4:26         ` Robert Dewar [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