comp.lang.ada
 help / color / mirror / Atom feed
* Strange warning message
@ 2017-11-27  8:40 reinert
  2017-11-27  9:00 ` Jacob Sparre Andersen
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: reinert @ 2017-11-27  8:40 UTC (permalink / raw)


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/


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-12-02  9:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27  8:40 Strange warning message reinert
2017-11-27  9:00 ` Jacob Sparre Andersen
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

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