This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

const static initializers versionitis



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;
}




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]