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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.109.56.179.183.mobile.3.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Strange warning message Date: Mon, 27 Nov 2017 10:00:40 +0100 Organization: JSA Research & Innovation Message-ID: <87wp2cxfif.fsf@jacob-sparre.dk> References: <7c246c12-77f6-45c9-a05a-9afe934df332@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: franka.jacob-sparre.dk; posting-host="109.56.179.183.mobile.3.dk:109.56.179.183"; logging-data="13290"; mail-complaints-to="news@jacob-sparre.dk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:ClO/8p6WCKbbfPibAKoRsUYDAqQ= Xref: reader02.eternal-september.org comp.lang.ada:49175 Date: 2017-11-27T10:00:40+01:00 List-Id: Reinert writes: > "warning: useless assignment to "test1", value never referenced" Yes. > procedure test1k is [...] > 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; As the warning says, you don't reference the variable "test1". If that is on purpose and you use GNAT, you can attach the aspect "Unreferenced" to "test1". Greetings, Jacob -- "Being an absolute ruler today was not as simple as people thought. At least, it was not simple if your ambitions included being an absolute ruler tomorrow."