comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Marciante <marciant@li.net>
Subject: Re: Simpler Question (was Assigning to dereferenced null access variable)
Date: 2000/11/07
Date: 2000-11-07T00:00:00+00:00	[thread overview]
Message-ID: <3A089948.5979@li.net> (raw)
In-Reply-To: 8u9r97$jmb$2@wanadoo.fr

Jean-Pierre Rosen wrote:
> 
> "Vincent Marciante" <marciant@li.net> a �crit dans le message news:3A0847ED.49AF@li.net...
> >[...]
> >     begin
> >         Null_Sequence.The_Characters(1..0) := Null_Characters;
> >         Put_Line("The Null_Characters assignment succeeded");
> >     exception
> >         when Constraint_Error =>
> >         Put_Line("The Null_Characters assignment caused
> > Constraint_Error");
> >         --OS/2 GNAT 3.12 raises Constraint_Error
> >     end;
> > end;
> Null_Sequence.The_Characters is a null pointer, there is no array to point to. This is what causes Constraint_Error, nothing to do
> with the assignment.
> 
> --
> ---------------------------------------------------------
>            J-P. Rosen (Rosen.Adalog@wanadoo.fr)
> Visit Adalog's web site at http://pro.wanadoo.fr/adalog

I thought that null_sequence.the_characters being a null pointer
should always cause constraint_error.   I will assume that you 
mean that the fact that no constraint_error ocurred in the first 
block (repeated below) indicates a compiler defect, so, I will send
a report to ACT.   Thanks.

    begin
        Null_Sequence.The_Characters(1..0) := Null_Characters(1..0);  
        Put_Line("The Null_Characters(1..0) assignment succeeded");
        --OS/2 GNAT 3.12 succeeds
    exception
        when Constraint_Error => 
        Put_Line("The Null_Characters(1..0) assignment caused Constraint_Error");
    end;




  reply	other threads:[~2000-11-07  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-05  0:00 Assigning to dereferenced null access variable Vincent Marciante
2000-11-07  0:00 ` Simpler Question (was Assigning to dereferenced null access variable) Vincent Marciante
2000-11-07  0:00   ` Jean-Pierre Rosen
2000-11-07  0:00     ` Vincent Marciante [this message]
2000-11-08  4:20       ` Robert Dewar
2000-11-08  0:00         ` GNAT for OS/2 (was Re: Simpler Question (was Assigning ...)) Vincent Marciante
2000-11-10  1:52           ` tjerick
2000-11-08  0:00         ` Simpler Question (was Assigning to dereferenced null access variable) Vincent Marciante
2000-11-09  4:43           ` Robert Dewar
replies disabled

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