comp.lang.ada
 help / color / mirror / Atom feed
* No_Implicit_Heap_Allocations
@ 2011-01-27 10:38 Maciej Sobczak
  2011-01-27 11:00 ` No_Implicit_Heap_Allocations Maciej Sobczak
  2011-01-27 11:06 ` No_Implicit_Heap_Allocations Mark Lorenzen
  0 siblings, 2 replies; 9+ messages in thread
From: Maciej Sobczak @ 2011-01-27 10:38 UTC (permalink / raw)


Consider this reduced test:

--  file p.ads:
package P is
   procedure Wait_Until_Something;
end P;

--  file p.adb:
package body P is

   protected Object is
      entry Wait_Until_Something;
   private
      Something : Boolean := False;
   end Object;

   protected body Object is
      entry Wait_Until_Something when Something is
      begin
         null;
      end Wait_Until_Something;
   end Object;

   procedure Wait_Until_Something is
   begin
      Object.Wait_Until_Something;
   end Wait_Until_Something;

end P;

--  file foo.adb:
pragma Restrictions (No_Implicit_Heap_Allocations);

with P;

procedure Foo is
begin
   null;
end Foo;

Now the interesting part:

$ gnatmake foo
gcc -c p.adb
gnatbind -x foo.ali
error: "foo.adb" has restriction No_Implicit_Heap_Allocations
error: but the following files violate this restriction:
error:   "p.adb"
gnatmake: *** bind failed.
$

What happens here? In what way p.adb violates the restriction on
implicit heap usage?
I don't see anything there that could possibly violate it and if it
does due to internals of this trivial protected object, then I think
Ravenscar programs are in trouble.

This is GNAT GPL 2009 on Linux-x86.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com



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

end of thread, other threads:[~2011-01-28 15:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 10:38 No_Implicit_Heap_Allocations Maciej Sobczak
2011-01-27 11:00 ` No_Implicit_Heap_Allocations Maciej Sobczak
2011-01-27 11:06 ` No_Implicit_Heap_Allocations Mark Lorenzen
2011-01-27 15:49   ` No_Implicit_Heap_Allocations Maciej Sobczak
2011-01-27 18:07     ` No_Implicit_Heap_Allocations Vinzent Hoefler
2011-01-27 22:13       ` No_Implicit_Heap_Allocations Maciej Sobczak
2011-01-28  5:15         ` No_Implicit_Heap_Allocations Yannick Duchêne (Hibou57)
2011-01-28 15:19           ` No_Implicit_Heap_Allocations Maciej Sobczak
2011-01-28 15:38             ` No_Implicit_Heap_Allocations Mark Lorenzen

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