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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Addressing in Object Ada v/s GNAT (2013) showing Vast Differences Date: Mon, 7 Sep 2015 08:48:57 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 7 Sep 2015 15:47:09 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ee44d3db9c41f5ad88d7e8e8f0268f05"; logging-data="6396"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DRFDsCWo916EPRvWbPL+jLzmyYKEPe6w=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: Cancel-Lock: sha1:4iG77uAzHZU0L6PfydPDWmbimMc= X-Enigmail-Draft-Status: N1110 Xref: news.eternal-september.org comp.lang.ada:27729 Date: 2015-09-07T08:48:57-07:00 List-Id: On 09/07/2015 04:39 AM, Lucas Redding wrote: > > I have a program that runs perfectly in Object Ada. The program relies > heavily on "USE AT" clauses together with 'SIZE on underlying type > definition. This is in order to map directly and deterministically to memory > with bit precision. The data is independently produced so this is very > important. "Use at" is the Ada-83 mechanism for specifying an object's address; since Ada 95 the form for V'Address use A; is preferred, and "use at" is considered obsolete. I would guess, then, that this program has been around for quite a while, having originally been Ada 83, and that there has been on-going effort to port it to new hardware, OS versions, and compilers to keep it available. Addresses are something that are platform and compiler dependent. It probably took a fair amount of effort to understand how Object Ada lays things out in memory to get to the version you currently have. A similar amount of effort should be expected to understand GNAT's approach to these things and to modify the representation clauses to achieve the same representation as OA. You've already found that GNAT wants to align things differently from OA, so specifying non-default alignments may be necessary. -- Jeff Carter "Why, the Mayflower was full of Fireflies, and a few horseflies, too. The Fireflies were on the upper deck, and the horseflies were on the Fireflies." Duck Soup 95