comp.lang.ada
 help / color / mirror / Atom feed
* Exceptions and out procedure arguments (using GNAT GPL)
@ 2007-06-16  1:05 Fionn Mac Cumhaill
  2007-06-16  1:53 ` Anh Vo
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: Fionn Mac Cumhaill @ 2007-06-16  1:05 UTC (permalink / raw)


Consider a procedure that starts like this:

procedure My_Procedure (
  O: out integer
)
is
begin

  -- various statements follow

  O := 999;

  -- more statements follow

  raise My_Exception;

I'm using GNAT GPL.

My question is:

Is the routine which calls My_Procedure guaranteed to get a value if
it does something like this?

X := 0;
My_Procedure(X);

and has an exception handler

exception
  when My_Exception =>
    null;

Will X get a value of 999? I.e., is an Ada compiler free to optimize
the code such that the assignment to the out variable O is moved to
some place after the point where the exception is raised?





^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2007-06-22 19:45 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-16  1:05 Exceptions and out procedure arguments (using GNAT GPL) Fionn Mac Cumhaill
2007-06-16  1:53 ` Anh Vo
2007-06-16  2:50 ` Brian May
2007-06-16  3:08 ` Randy Brukardt
2007-06-16  6:55 ` Dmitry A. Kazakov
2007-06-18 15:44 ` Adam Beneschan
2007-06-19  5:23   ` Fionn Mac Cumhaill
2007-06-19  7:34     ` Maciej Sobczak
2007-06-19 15:21       ` Adam Beneschan
2007-06-19 20:07         ` Dmitry A. Kazakov
2007-06-19 21:20           ` Adam Beneschan
2007-06-20  6:16             ` Georg Bauhaus
2007-06-20  8:01             ` Dmitry A. Kazakov
2007-06-20  8:45               ` Georg Bauhaus
2007-06-20  9:29                 ` Dmitry A. Kazakov
2007-06-20  6:21           ` Georg Bauhaus
2007-06-20  8:02             ` Dmitry A. Kazakov
2007-06-20  8:46               ` Georg Bauhaus
2007-06-20  9:29                 ` Dmitry A. Kazakov
2007-06-20 10:13                   ` Georg Bauhaus
2007-06-20 12:58                     ` Dmitry A. Kazakov
2007-06-20 14:16                       ` Georg Bauhaus
2007-06-20 18:22                         ` Dmitry A. Kazakov
2007-06-20 19:16                           ` Georg Bauhaus
2007-06-20 20:40                             ` Dmitry A. Kazakov
2007-06-21  9:52                               ` Georg Bauhaus
2007-06-21 13:48                                 ` Dmitry A. Kazakov
2007-06-22 18:15                                   ` Georg Bauhaus
2007-06-22 19:45                                     ` Dmitry A. Kazakov
2007-06-20 15:15         ` Fionn Mac Cumhaill
2007-06-19 21:40     ` Randy Brukardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox