From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gianni Mariani To: gianni@mariani.ws (Gianni Mariani) Cc: gcc@gcc.gnu.org (gcc@gcc.gnu.org) Subject: Re: const static initializers versionitis Date: Tue, 22 Aug 2000 08:12:00 -0000 Message-id: <200008221512.IAA02303@uluru.mariani.ws> References: <399D59BD.B2753D37@mariani.ws> X-SW-Source: 2000-08/msg00442.html help - please ... Why were forward declarations of const arrays removed from g++ since 2.95.2 ? Isn't this a gcc bug ? i.e. not being able to forward declare an array instance ? The code still compiles fine in gcc so I would have some level of expectation that "const"ness should not change the behaviour of the compiler. Is there a compiler switch that reinstates the desired behaviour ? > > > The code below compiles fine with egcs-2.91.66 but fails with 2.95.2 and > > 2.95.3 . Am I missing somthing ? Any way of getting the egcs-2.91.66 > behaviour in 2.95.3 ? > > g++2.95.2 -c yy.cpp > yy.cpp:7: uninitialized const `bar' > yy.cpp:9: uninitialized const `tar' > --------- yy.cpp ----------- struct foo { const struct foo * y; char who[ 10 ]; }; const static struct foo bar[]; const static struct foo tar[]; const static struct foo bar[] = { tar, "bar" }; const static struct foo tar[] = { bar, "tar" }; const char * zefuc() { return tar->y->who; }