comp.lang.ada
 help / color / mirror / Atom feed
* [bug: gnat gpl 2006] call to entry with 'not null' formal causes exception
@ 2006-07-17 14:16 Alex R. Mosteo
  0 siblings, 0 replies; only message in thread
From: Alex R. Mosteo @ 2006-07-17 14:16 UTC (permalink / raw)


Hello,

since it seemed to me that there was some interest on bugs found in
the "free" compiler, I'm posting here my findings in addition to submitting
them to the debian tracker. I hope the proper tagging in the subject makes
this practice non-disturbing for people not interested in gnat.

Ludovic, is it ok to submit bugs that are not for any debian package, or
should I only submit bugs for the newest 4.1 version? I can check these, I
have both versions installed.

Summary: passing a not null access value to a not null entry parameter will
nonetheless raise an exception (a foretelling warning is issued during
compilation):

----8<----------
with Ada.Exceptions; use Ada.Exceptions;
with Text_Io; use Text_Io;
procedure Bug is

   type Ai is access all Integer;

   task TI is
      entry Set (I : not null AI);
   end TI;

   task body TI is
   begin
      accept Set (I : not null AI);
   end TI;

   X : aliased Integer := 0;
begin
   Ti.Set (X'Access);

exception 
   when E : others =>
      Put_Line (Exception_Message (E));
      abort TI;
end;
------8<--------------------

Execution:

$ gnatmake bug && echo Launching... && ./bug
gcc -c bug.adb
bug.adb:18:06: warning: (Ada 2005) null-excluding objects must be
initialized
bug.adb:18:06: warning: "Constraint_Error" will be raised at run time
gnatbind -x bug.ali
gnatlink bug.ali
Launching...
bug.adb:18 null-exclusion check failed

Removing the not null it works fine...



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-17 14:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-17 14:16 [bug: gnat gpl 2006] call to entry with 'not null' formal causes exception Alex R. Mosteo

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