comp.lang.ada
 help / color / mirror / Atom feed
From: aaward@my-dejanews.com
Subject: Access to procedure causes Program_Error
Date: 1998/07/30
Date: 1998-07-30T00:00:00+00:00	[thread overview]
Message-ID: <6pqn39$ir$1@nnrp1.dejanews.com> (raw)

I'm using GNAT 3.10p on NT 4.0 and have this little oddity I need some help
with: I'm working on a project where an access to procedure is passed to one
procedure, which in turn passes it to a second procedure for use. This scheme
works fine when GNAT is run without optimizations, however when using -O3 it
causes a Program_Error when the second procedure tries to call the access to
procedure. At -O1 it appears to hang; I'm not sure what happens, but it's off
in la-la land. Has anyone else encountered this behavior, or am I on to
something in GNAT?

Some code snippets for your inspection... other parameters and code omitted.

   procedure Run_Forecast (
         Allocation_Callback : Allocation_Status_Callback
         := Null_Allocation_Callback'access;
         ) is
   begin
   -- ...
      Do_Allocation(Allocation_Callback);
   -- ...
   end Run_Forecast;

   procedure Do_Allocation (
         Status_Callback  : in     Allocation_Status_Callback
         ) is
   begin
   -- ...
      Status_Callback (Iteration, Forecast.Data, Constraint);
   -- ...
   end Do_Allocation;

The -O3 Program_Error occurs at the call to Status_Callback, but works fine
without optimization.

Any clues are appreciated...

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




                 reply	other threads:[~1998-07-30  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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