From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Addressing in Object Ada v/s GNAT (2013) showing Vast Differences
Date: Mon, 21 Sep 2015 15:47:37 +0200
Date: 2015-09-21T15:47:37+02:00 [thread overview]
Message-ID: <87wpvj51fq.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: 2c064071-2e40-4267-81f6-3196d7ae35ab@googlegroups.com
Lucas Redding wrote:
> thanks for that. I am avoiding having to flood this with tons of
> code. So here is a compiled example.
You missed a test routine, so I wrote one:
with Ada.Text_IO;
with Interface_P;
procedure Use_Interface_P is
type Word is mod 2 ** 32;
Data : Word with Import, Address => Interface_P.Var_Rec'Address;
Remote : Interface_P.Rec;
Local : Interface_P.Local_Rec;
begin
for Test_Value in Word loop
Data := Test_Value;
Remote := Interface_P.Var_Rec;
Local := Interface_P.Read_Record;
if Word (Remote.A) /= Word (Local.A) or
Word (Remote.B) /= Word (Local.B)
then
Ada.Text_IO.Put_Line ("Test value:" & Data'Img);
Ada.Text_IO.Put_Line ("A:" & Remote.A'Img & " -> " & Local.A'Img);
Ada.Text_IO.Put_Line ("B:" & Remote.B'Img & " -> " & Local.B'Img);
Ada.Text_IO.New_Line;
elsif Test_Value mod 2 ** 24 = 0 then
Ada.Text_IO.Put_Line ("Test value:" & Data'Img);
end if;
end loop;
end Use_Interface_P;
Compiled with
gnatmake -gnata -gnato -fstack-check -gnat12 -gnatyO -gnatv -gnati1 -gnatf -gnatn -m -j4 use_interface_p
the program runs without any errors, so you may have misconfigured your
compiler somehow.
Greetings,
Jacob
--
"The point is that I am now a perfectly safe penguin!"
next prev parent reply other threads:[~2015-09-21 13:47 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 11:39 Addressing in Object Ada v/s GNAT (2013) showing Vast Differences Lucas Redding
2015-09-07 11:54 ` Lucas Redding
2015-09-07 14:04 ` G.B.
2015-09-07 16:02 ` Lucas Redding
2015-09-07 16:28 ` Anh Vo
2015-09-08 7:30 ` Lucas Redding
2015-09-08 15:11 ` Anh Vo
2015-09-08 17:20 ` Jeffrey R. Carter
2015-09-07 17:20 ` Pascal Obry
2015-09-07 17:21 ` Pascal Obry
2015-09-08 7:04 ` Lucas Redding
2015-09-07 21:02 ` Niklas Holsti
2015-09-08 8:00 ` Lucas Redding
2015-09-07 15:48 ` Jeffrey R. Carter
2015-09-08 7:27 ` Lucas Redding
2015-09-08 7:12 ` Markus Schöpflin
2015-09-08 8:05 ` Lucas Redding
2015-09-10 10:47 ` Lucas Redding
2015-09-10 12:34 ` G.B.
2015-09-21 11:12 ` Lucas Redding
2015-09-21 11:57 ` Jacob Sparre Andersen
2015-09-21 13:22 ` Lucas Redding
2015-09-21 13:47 ` Jacob Sparre Andersen [this message]
2015-09-21 13:52 ` Georg Bauhaus
2015-09-21 15:54 ` Lucas Redding
2015-09-22 17:49 ` Jacob Sparre Andersen
2015-09-22 18:45 ` Jacob Sparre Andersen
2015-10-01 6:50 ` Lucas Redding
2015-09-21 16:48 ` Dmitry A. Kazakov
2015-10-01 7:25 ` Lucas Redding
2015-10-01 20:04 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox