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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ace9bff8eb84e5b1,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p43g2000hsc.googlegroups.com!not-for-mail From: shaunpatterson@gmail.com Newsgroups: comp.lang.ada Subject: Generic Zero Length Array Date: Fri, 22 Feb 2008 05:31:19 -0800 (PST) Organization: http://groups.google.com Message-ID: <9b771018-fb0b-42eb-ae00-12ee3eda69b2@p43g2000hsc.googlegroups.com> NNTP-Posting-Host: 155.219.241.10 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1203687079 6769 127.0.0.1 (22 Feb 2008 13:31:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 22 Feb 2008 13:31:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p43g2000hsc.googlegroups.com; posting-host=155.219.241.10; posting-account=O0hwoQoAAABTUhctVKyLpysYxVt3QnYo User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19968 Date: 2008-02-22T05:31:19-08:00 List-Id: 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