comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <jacob@jacob-sparre.dk>
Subject: Re: Strange warning message
Date: Mon, 27 Nov 2017 10:00:40 +0100
Date: 2017-11-27T10:00:40+01:00	[thread overview]
Message-ID: <87wp2cxfif.fsf@jacob-sparre.dk> (raw)
In-Reply-To: 7c246c12-77f6-45c9-a05a-9afe934df332@googlegroups.com

Reinert <reinkor@gmail.com> 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."

  reply	other threads:[~2017-11-27  9:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  8:40 Strange warning message reinert
2017-11-27  9:00 ` Jacob Sparre Andersen [this message]
2017-11-27  9:13   ` reinert
2017-11-27  9:45     ` Jacob Sparre Andersen
2017-11-27 10:43       ` reinert
2017-11-27  9:01 ` gautier_niouzes
2017-11-27  9:09   ` gautier_niouzes
2017-11-27  9:27     ` reinert
2017-11-27 10:42 ` Jeffrey R. Carter
2017-11-27 10:47   ` reinert
2017-11-27 11:52     ` reinert
2017-11-29  0:43 ` Robert Eachus
2017-11-29 10:39   ` reinert
2017-11-29 20:47     ` Randy Brukardt
2017-11-30 14:11       ` reinert
2017-12-01 22:53     ` Robert Eachus
2017-12-02  8:47       ` Simon Wright
2017-12-02  9:47         ` Niklas Holsti
replies disabled

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