"Egil H�vik" wrote in message news:2446841a-8bb0-46bc-94ed-099e4e0ca74c@k2g2000hse.googlegroups.com... >On Feb 22, 2:31 pm, shaunpatter...@gmail.com wrote: >> 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: ... >A new generic parameter Null_Element would do the trick, but >that means changing code wherever the generic is used... > >type Element is (<>); >type Element_List is array (Indexing range <>) of Element; >Null_Element : Element; > >then you could rewrite the above code to > >if Error_Condition then > return Element_List'(Indexing'First..Indexing'First-1 => Null_Element); >end if; If you are not limited to Ada 95, you can use the <> here, and then you don't need the extra generic parameter: if Error_Condition then return Element_List'(Indexing'First..Indexing'First-1 => <>); end if; Randy. -- ~egilhh