From: reinert <reinkor@gmail.com>
Subject: Did I find a (nearly-)gotcha here?
Date: Fri, 12 Nov 2021 23:46:09 -0800 (PST) [thread overview]
Message-ID: <29091147-1b81-4a3b-a646-c6a6d1ebe4ean@googlegroups.com> (raw)
Hello,
Assume the following program:
with Text_Io; use Text_Io;
procedure test2 is
procedure test_a(ok : out Boolean) is
begin
if false then
ok := true;
end if;
end test_a;
procedure test_b(ok : in out Boolean) is
begin
if false then
ok := true;
end if;
end test_b;
ok_a,ok_b : Boolean := true;
begin
test_a(ok_a);
test_b(ok_b);
Put_Line("ok_a = " & ok_a'Image);
Put_Line("ok_b = " & ok_b'Image);
end test2;
I get the following output (using GNAT Community Edition):
ok_a = FALSE
ok_b = TRUE
As far as I understand, this is correct.
However, I think I remember that (some) older versions of the GNAT compiler gave a different result. Could others try? And does my program example reveal an unnecessary gotcha?
reinert
next reply other threads:[~2021-11-13 7:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-13 7:46 reinert [this message]
2021-11-13 8:52 ` Did I find a (nearly-)gotcha here? Niklas Holsti
2021-11-13 8:53 ` Rod Kay
2021-11-14 8:25 ` G.B.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox