comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: 'size attribute inheritance
Date: 1997/08/10
Date: 1997-08-10T00:00:00+00:00	[thread overview]
Message-ID: <dewar.871238340@merv> (raw)
In-Reply-To: 33ECF679.4B5D@lmco.com


<<     When running this code, we get a bus alignment error.  We tracked
it
     down to the fact that the compiler does NOT really allocate 16 bits
     for Month with subtype Month_Type.  We assumed that since>>


This is definitely a compiler bug, there is no way that legal declarations
that are accepted by the compiler can lead to bus errors.

However, the treatment of the size attribute seems to be quite in accord
with the RM. Ada 95 effectively introduced pretty serious incompatibilites
in the handling of 'Size by requiring an interpretaytion that was legal
in Ada 83 (and happened by no mere coincidence to be the one used by
the Intermetrics compiler :-) but was not typical of Ada 83 compilers.

So a lot of old code breaks but the break should consist of rejections
at compile time: NOT bus errors!

GNAT has introduced new attributes Value_Size and Object_Size wjhich can
be applied to subtypes as well as first named types, to provide complete
control over sizes, and allow old code to be easily ported no matter what
conventions the compiler on which it was compiled was using.

Our default conventions are as close as we are allowed to the VADS compiler,
but we are not allowed to be 100% compatible. In any case the bus error
is a serious bug. From the description, it does not sound like you are
using GNAT, and certainly the current version of GNAT does what you
expect with the declarations you gave.





  parent reply	other threads:[~1997-08-10  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-09  0:00 'size attribute inheritance Carlos Palenzuela
1997-08-10  0:00 ` Robert A Duff
1997-08-10  0:00 ` Matthew Heaney
1997-08-11  0:00   ` Robert Dewar
1997-08-12  0:00     ` Matthew Heaney
1997-08-13  0:00       ` Robert A Duff
1997-08-13  0:00         ` Matthew Heaney
1997-08-14  0:00           ` Robert A Duff
1997-08-14  0:00             ` Dale Stanbrough
1997-08-16  0:00           ` Robert Dewar
1997-08-16  0:00             ` Ken Garlington
1997-08-17  0:00               ` Robert A Duff
1997-08-17  0:00               ` Robert Dewar
1997-08-18  0:00                 ` Robert A Duff
     [not found]                   ` <dewar.872433846@merv>
1997-09-03  0:00                     ` Robert A Duff
1997-09-06  0:00                       ` Robert Dewar
1997-09-08  0:00                         ` Robert A Duff
1997-08-13  0:00       ` Ken Garlington
1997-08-13  0:00         ` Matthew Heaney
1997-08-10  0:00 ` Robert Dewar [this message]
1997-08-11  0:00   ` Matthew Heaney
1997-08-11  0:00   ` Ken Garlington
replies disabled

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