From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT GPL 2013 bug? Date: Fri, 09 Aug 2013 19:25:57 +0100 Organization: A noiseless patient Spider Message-ID: References: <19fr4wmxmen$.gjbias2fj461$.dlg@40tude.net> <72539e4c-dddd-40e4-82e8-14c4f2016ccc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="ab63a21f76991e88ee5b3b5ea015b144"; logging-data="18890"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CVahxAiu+JKc5xTVUB3LEDGZ2DjI+Crs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:+FVUwWlwL5DFnBoM+9g1wqQeKKY= sha1:3YjcvW4X6LaMeplb/aRe6zI7TS0= X-Original-Bytes: 2766 Xref: number.nntp.dca.giganews.com comp.lang.ada:182886 Date: 2013-08-09T19:25:57+01:00 List-Id: Adam Beneschan 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