From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ad4aec717fd8556e X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: 'size attribute inheritance Date: 1997/08/10 Message-ID: #1/1 X-Deja-AN: 263491359 References: <33ECF679.4B5D@lmco.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-08-10T00:00:00+00:00 List-Id: << 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.