From: hware@cs.wvu.edu (Henry Ware)
Subject: Ada strangeness or bug in Gnat?
Date: 1996/11/06
Date: 1996-11-06T00:00:00+00:00 [thread overview]
Message-ID: <E0FBxy.Jwq@cerc.wvu.edu> (raw)
Hi,
Heres some sample code:
---Cut Here
with Ada.Text_Io, Ada.Integer_text_io;
use Ada.Text_Io, Ada.Integer_text_io;
procedure foo3 is
type Int2_Array is array (1..2) of Integer;
-- Return the same values sorted in ascending order
procedure Sort_Int2 (Unsorted : in Int2_array; Sorted : out Int2_array) is
begin
if ( Unsorted(1) < Unsorted(2) ) then
Sorted(1):=Unsorted(1);
Sorted(2):=Unsorted(2);
else
Sorted(1):=Unsorted(2);
Sorted(2):=Unsorted(1);
end if;
end Sort_Int2;
Z: Int2_array;
begin
Z(1):=2;
Z(2):=1;
-- This should(?) act like a swap
Sort_Int2(Z(1..2),Z(1..2));
-- ...but actually returns 1,1
Put(Z(1));
New_Line;
Put(Z(2));
New_Line;
end foo3;
--Cut Here
The same code works as expected if arrays are not used: ie the
procedure takes 4 arguments.
Is this correct? We are using Gnat3.03.
Thanks,
--
Henry Ware hware@cs.wvu.edu
% rm file
rm: remove file? y
rm: you realize that you'll never get it back? y
rm: wouldn't you rather keep it? n
rm: ok, now let me get this straight. you voted for clinton last election
and you want me to trust your judgment on deleting this file. personally,
i don't feel you're qualified for a decision of this caliber. how about
we run xeyes instead? n
rm: are you absolutely positively sure that you want to remove this file? y
rm: hesitation detected in reply. file not removed.
next reply other threads:[~1996-11-06 0:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-11-06 0:00 Henry Ware [this message]
1996-11-05 0:00 ` Ada strangeness or bug in Gnat? Vincent Celier
1996-11-06 0:00 ` Ronald Cole
1996-11-06 0:00 ` Robert Dewar
1996-11-06 0:00 ` Joerg Rodemann
1996-11-06 0:00 ` Vincent Celier
1996-11-07 0:00 ` Peter Amey
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox