comp.lang.ada
 help / color / mirror / Atom feed
* Generic Zero Length Array
@ 2008-02-22 13:31 shaunpatterson
  2008-02-22 13:53 ` Egil Høvik
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: shaunpatterson @ 2008-02-22 13:31 UTC (permalink / raw)


I have a bit of legacy code in my system that I am trying to remove
all warnings from.

The package is a generic -- with:

type Element is (<>);
type Element_List is array (Indexing range <>) of Element;


I have been stumped by one compiler warning where one of the functions
needs to return a zero-length empty generic array:

warning: variable Result_String is read but never assigned

code:

if Error_Condition then
  declare
    type Result is new Element_List (Indexing.First + 1 ..
Indexing'First);
    Result_String : Result;
  begin
     return Element_List (Result);
  end;
end if;

How do I initialize this array when I can't know what type it is or
will be?

Thanks

--
Shaun




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

end of thread, other threads:[~2008-02-25 19:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-22 13:31 Generic Zero Length Array shaunpatterson
2008-02-22 13:53 ` Egil Høvik
2008-02-22 13:55   ` shaunpatterson
2008-02-22 14:11     ` Georg Bauhaus
2008-02-22 19:25   ` Randy Brukardt
2008-02-22 19:25   ` Randy Brukardt
2008-02-22 19:25   ` Randy Brukardt
2008-02-22 23:01     ` Adam Beneschan
2008-02-23  9:30       ` Dmitry A. Kazakov
2008-02-23 14:27       ` Robert A Duff
2008-02-23 16:16         ` Dmitry A. Kazakov
2008-02-25 16:41         ` Adam Beneschan
2008-02-25 19:14           ` Robert A Duff
2008-02-22 14:23 ` Stefan Lucks
2008-02-22 16:52   ` Adam Beneschan
2008-02-22 14:26 ` Robert A Duff
2008-02-22 15:22 ` Stefan Bellon
2008-02-22 23:03   ` Adam Beneschan
2008-02-23 10:19     ` Stefan Bellon

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