C++ chokes on static char foo[]={"bar"};

Jakub Jelinek jakub@redhat.com
Fri Jun 2 05:42:00 GMT 2000


Hi!

C++ dies with initializer-string for array of chars is too long
even if the size of array is not specified:

static const char foo[] = {"bar"};

This works just fine in C and used to work with older C++ as well.
c-typeck.c digest_init allows this because it checks whether either
TYPE_DOMAIN is NULL_TREE in comptypes, but for C++ it seems like TYPE_DOMAIN
is always NULL, so I'm not sure how to fix this...

	Jakub


More information about the Gcc-bugs mailing list