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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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: "G.B." Newsgroups: comp.lang.ada Subject: Re: Addressing in Object Ada v/s GNAT (2013) showing Vast Differences Date: Mon, 7 Sep 2015 16:04:40 +0200 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 7 Sep 2015 14:02:50 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="13000"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HL4xCQrWlg7gYmzd9Rk+5aecwlDRlDoU=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: Cancel-Lock: sha1:PGaJ2KfjSH+1+2a2NFh/v+zV1vU= Xref: news.eternal-september.org comp.lang.ada:27727 Date: 2015-09-07T16:04:40+02:00 List-Id: On 07.09.15 13:54, Lucas Redding wrote: > On Monday, September 7, 2015 at 12:39:35 PM UTC+1, Lucas Redding wrote: >> Hi >> >> I was wondering how the addressing mechanism works in GNAT Ada? Is it so vastly different to Object Ada? Is there a way I can tailor the GNAT addressing mechanism to follow that of Object Ada? >> >> 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. >> >> I have compiled the program is GNAT Ada but I am getting run time errors such as "misaligned address value". More worryingly, any data read from memory that relies on the addressing mechanisms described above is incoherent. >> >> I am interested in moving to GNAT Ada because I believe the accompanying toolset is much richer and therefore more productive but I am beginning to wonder whether this is too onerous task? >> >> Any help is greatly appreciated. >> >> Lucas > > Hi, > > I forgot to say that platform is Windows 7 (64 bit if that matters) and the data is in S_RECORD format (With correct ENDIANISM). > > Any help is greatly appreciated. In case you haven't already found it, a look at GNAT chosen representation is possible when translating with the -gnatR?[s] options. I also assume you have been specifying alignment of types/objects? Maybe also including fields for padding?