Programming

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
Home » Tech Support »» Programming
  • call to entry with 'not null' formal causes exception

    0 answers - 1531 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

    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):
    <
    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;
    <
    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

Re: call to entry with 'not null' formal causes exception


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 1 =
SPONSORED
QUESTION

SPONSORED
EMSDN