This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
const static initializers versionitis
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Subject: const static initializers versionitis
- From: Gianni Mariani <gianni at mariani dot ws>
- Date: Fri, 18 Aug 2000 08:43:57 -0700
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;
}