This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: const static initializers versionitis
Forgot to mention - tried that !
I want a "static" - so declaring it extern is specifically not
what I (ideally) would want. i.e. can't have an "extern static"
declaration.
$ g++ -c yy.cpp
yy.cpp:7: multiple storage classes in declaration of `bar'
yy.cpp:9: multiple storage classes in declaration of `tar'
------------ new yy.cpp ---------------
struct foo {
const struct foo * y;
char who[ 10 ];
};
extern const static struct foo bar[];
extern 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;
}
>
> On Aug 22, 2000, Gianni Mariani <gianni@mariani.ws> wrote:
>
> > So how does one forward declare a const POD?
>
> > Alexandre Oliva wrote:
>
> >> `extern' is the keyword to forward-declare data in namespace scope.
>
> --
> Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist *Please* write to mailing lists, not to me