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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.20.87 with SMTP id 84mr22685087iou.31.1511772040645; Mon, 27 Nov 2017 00:40:40 -0800 (PST) X-Received: by 10.157.81.193 with SMTP id d1mr1637215oth.13.1511772040564; Mon, 27 Nov 2017 00:40:40 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!i6no7243557itb.0!news-out.google.com!193ni4277iti.0!nntp.google.com!i6no7243553itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 27 Nov 2017 00:40:40 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.167.214.186; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 85.167.214.186 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7c246c12-77f6-45c9-a05a-9afe934df332@googlegroups.com> Subject: Strange warning message From: reinert Injection-Date: Mon, 27 Nov 2017 08:40:40 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 14458847 X-Received-Bytes: 2291 Xref: reader02.eternal-september.org comp.lang.ada:49173 Date: 2017-11-27T00:40:40-08:00 List-Id: Hei there, when I compile the enclosed program with option "-gnatwa" (i.e. "gnatmake -gnatwa test1k.adb", I get the following annoying warning: "warning: useless assignment to "test1", value never referenced" I use debian, updated (gnat-6 6.3.0-18). Do others out there get the same warning when compiling the test program below? Is there a bug to blame in my version of the compiler? Just to relax - or it seems I do something bad? :-) Here is the program: ----------------------------------------------------------------- with Text_IO; procedure test1k is task type test1_t; task body test1_t is begin Text_IO.Put_Line("Hello there!"); end test1_t; test1 : array(1..1) of access test1_t; begin for e of test1 loop e := new test1_t; end loop; -- Commenting out this statement makes the warning disapipear: test1(1) := new test1_t; end test1k; ------------------------------------------------------------------- I here make the array "test1" only to illustrate (it can serve as an ugly trick to get rid of the warning message). reinert https://korsnesbiocomputing.no/