From: Simon Wright <simon@pushface.org>
Subject: Re: GNAT GPL 2013 bug?
Date: Fri, 09 Aug 2013 19:25:57 +0100
Date: 2013-08-09T19:25:57+01:00 [thread overview]
Message-ID: <lyli4araa2.fsf@pushface.org> (raw)
In-Reply-To: fe9f4149-1552-427a-96ed-a92d7ef679d5@googlegroups.com
Adam Beneschan <adambeneschan@aol.com> writes:
> On Friday, August 9, 2013 9:11:35 AM UTC-7, Simon Wright wrote:
>
>> > In some of the examples in your later post (like the one where Q is
>> > private and the full type is a tagged record), there isn't a problem
>> > either, since the procedure isn't dispatching.
>>
>> So when GNAT says, at the procedure call, that a null value isn't
>> allowed and that CE will be raised, it's wrong?
>
> I just tried it on a case with "type Q is private" [not tagged] and a
> full definition "type Q is tagged null record", and I didn't get a
> warning. In the example you posted, GNAT is correct to display a
> warning, but your procedure *is* dispatching, and this situation isn't
> the same as the part of my post that you quoted.
I was talking about a slightly different case, corresponding to yours I
think:
package Dmitry is
type Q is private;
procedure P (X : access Q) is null;
private
type Q is tagged null record;
end Dmitry;
with Dmitry; use Dmitry;
procedure Test_Dmitry is
Y : access Q;
begin
P (Y); ------ dmitry.ada:11
end Test_Dmitry;
and get (GCC 4.8.1 and GNAT GPL 2013):
gnatmake test_dmitry.adb -gnat12 -f
gcc -c -gnat12 test_dmitry.adb
dmitry.ada:9:04: warning: variable "Y" is read but never assigned
dmitry.ada:11:07: warning: null value not allowed here
dmitry.ada:11:07: warning: "Constraint_Error" will be raised at run time
gcc -c -gnat12 dmitry.ads
gnatbind -x test_dmitry.ali
gnatlink test_dmitry.ali
next prev parent reply other threads:[~2013-08-09 18:25 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 9:47 GNAT GPL 2013 bug? Dmitry A. Kazakov
2013-08-09 10:38 ` sbelmont700
2013-08-09 11:01 ` Dmitry A. Kazakov
2013-08-09 11:06 ` sbelmont700
2013-08-09 11:36 ` Dmitry A. Kazakov
2013-08-09 15:48 ` Adam Beneschan
2013-08-09 16:11 ` Simon Wright
2013-08-09 16:52 ` Adam Beneschan
2013-08-09 18:25 ` Simon Wright [this message]
2013-08-09 18:39 ` Adam Beneschan
2013-08-09 19:28 ` Adam Beneschan
2013-08-09 20:05 ` Robert A Duff
2013-08-09 20:30 ` Adam Beneschan
2013-08-09 21:35 ` Simon Wright
2013-08-10 15:10 ` Shark8
2013-08-09 16:03 ` Simon Wright
2013-08-09 18:55 ` Randy Brukardt
2013-08-09 19:27 ` Dmitry A. Kazakov
2013-08-09 20:04 ` Robert A Duff
2013-08-10 6:51 ` Dmitry A. Kazakov
2013-08-12 16:52 ` Adam Beneschan
2013-08-12 17:03 ` Dmitry A. Kazakov
2013-08-12 17:20 ` Adam Beneschan
2013-08-12 18:34 ` Dmitry A. Kazakov
2013-08-12 20:12 ` Randy Brukardt
2013-08-13 6:43 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox