comp.lang.ada
 help / color / mirror / Atom feed
* Optional body for nested generic
@ 2011-09-20 12:48 Simon Wright
  2011-09-20 15:00 ` Adam Beneschan
  2011-09-20 15:15 ` Robert A Duff
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Wright @ 2011-09-20 12:48 UTC (permalink / raw)


I was surprised to find that GNAT makes it optional to have a body for a
nested generic package (in the code below, gpack1 has an empty body,
gpack2 doesn't have a body at all).

package Pack is
   pragma Elaborate_Body;
   generic
   package Gpack1 is
      procedure Proc;
      pragma Import (C, Proc, "proc");
   end Gpack1;
   generic
   package Gpack2 is
      procedure Proc;
      pragma Import (C, Proc, "proc");
   end Gpack2;
end Pack;

package body Pack is
   package body Gpack1 is
   end Gpack1;
end Pack;

I suppose that the reasoning for disallowing unrequired bodies (roughly,
making it impossible to obsolete the ada library by adding/removing
something with no other impact) only applies at library level, where
there's a correspondence to a file?



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

end of thread, other threads:[~2011-09-23  0:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-20 12:48 Optional body for nested generic Simon Wright
2011-09-20 15:00 ` Adam Beneschan
2011-09-20 15:18   ` Simon Wright
2011-09-20 15:15 ` Robert A Duff
2011-09-21 15:01   ` Adam Beneschan
2011-09-22  3:43     ` Randy Brukardt
2011-09-22 14:28       ` Robert A Duff
2011-09-22 23:03         ` Randy Brukardt
2011-09-23  0:03           ` Adam Beneschan

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